Project
sereto.project
¶
copy_skel(templates, dst, overwrite=False)
¶
Copy the content of a templates skel
directory to a destination directory.
A skel
directory is a directory that contains a set of files and directories that can be used as a template
for creating new projects. This function copies the contents of the skel
directory located at
the path specified by templates
to the destination directory specified by dst
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
templates
|
DirectoryPath
|
The path to the directory containing the |
required |
dst
|
DirectoryPath
|
The destination directory to copy the |
required |
overwrite
|
bool
|
Whether to allow overwriting of existing files in the destination directory.
If |
False
|
Raises:
Type | Description |
---|---|
SeretoPathError
|
If the destination directory already exists and |
Source code in sereto/project.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
|
init_build_dir(project, version)
¶
Initialize the build directory.
Source code in sereto/project.py
36 37 38 39 40 41 42 43 44 45 46 |
|
load_project(f)
¶
Decorator which loads the Project
from filesystem.
Source code in sereto/project.py
25 26 27 28 29 30 31 32 33 |
|
new_project(projects_path, templates_path, id, name)
¶
Generates a new project with the specified ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
projects_path
|
DirectoryPath
|
The path to the projects directory. |
required |
templates_path
|
DirectoryPath
|
The path to the templates directory. |
required |
id
|
TypeProjectId
|
The ID of the new project. This should be a string that uniquely identifies the project. |
required |
name
|
str
|
The name of the new project. |
required |
Raises:
Type | Description |
---|---|
SeretoValueError
|
If a project with the specified ID already exists in the |
Source code in sereto/project.py
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
|
project_create_missing(project, version)
¶
Creates missing target directories from config.
This function creates any missing target directories and populates them with content of the "skel" directory from templates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
project
|
Project
|
Project's representation. |
required |
version
|
ProjectVersion
|
The version of the project. |
required |
Source code in sereto/project.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|