get_project_templates
Lists the project templates new_project can create a project from — the ones shipped with CAT, or the ones on the CAT server.
On this page
Signature
cat.get_project_templates(online: bool = False, logging_level: LoggingLevel = None)
Parameters
| Parameter | Type | Default | Meaning |
|---|---|---|---|
online |
bool | False |
True: list the templates on the CAT server instead of the local ones. Nothing is downloaded by listing. |
logging_level |
LoggingLevel | None |
cat.LoggingLevel member; used only when this is the first call of the process. See Logging. |
What it does
Without online, returns the templates available locally — the two shipped with CAT (default, getStartedWindows) and any downloaded earlier. With online=True, asks the CAT server for its list, which may hold more templates and newer versions. Signs in like every project function.
Returns
A .NET collection of ProjectTemplate objects: TemplateCode — what new_project(template=…) takes, TemplateName, Description, Version.
Raises
The sign-in and plan check (first call of the process) raises the CatPortalError family listed on the Introduction page.
Examples
for t in cat.get_project_templates():
print(t.TemplateCode, t.Version, "-", t.Description)
for t in cat.get_project_templates(online=True):
print(t.TemplateCode, t.Version)
Related
- Introduction — session model, logging, .NET objects, exceptions, sign-in.
new_project— use a template.