Project management¶
-
class
boussole.project.
ProjectBase
(backend_name='json', **kwargs)[source]¶ Project base
Keyword Arguments: backend_name (string) – Default backend name, can be either json
oryaml
. Default value isjson
.-
_engines
¶ Available Configuration backends. Read only.
-
backend_name
¶ Backend name to use from available ones.
-
backend_engine
¶ Backend engine selected from given name.
-
get_backend_engine
(name, **kwargs)[source]¶ Get backend engine from given name.
Parameters: (string) – Path to validate. Raises: boussole.exceptions.SettingsBackendError
– If given backend name does not match any available engine.Returns: Instance of selected backend engine. Return type: object
-
-
class
boussole.project.
ProjectStarter
(backend_name='json', **kwargs)[source]¶ Provide methods to create a new SASS Project
-
commit
(sourcedir, targetdir, abs_config, abs_sourcedir, abs_targetdir)[source]¶ Commit project structure and configuration file
Parameters: - sourcedir (string) – Source directory path.
- targetdir (string) – Compiled files target directory path.
- abs_config (string) – Configuration file absolute path.
- abs_sourcedir (string) –
sourcedir
expanded as absolute path. - abs_targetdir (string) –
targetdir
expanded as absolute path.
-
expand
(basedir, config, sourcedir, targetdir, cwd)[source]¶ Validate that given paths are not the same.
Parameters: - basedir (string) – Project base directory used to prepend relative paths. If empty or equal to ‘.’, it will be filled with current directory path.
- config (string) – Settings file path.
- sourcedir (string) – Source directory path.
- targetdir (string) – Compiled files target directory path.
- cwd (string) – Current directory path to prepend base dir if empty.
Returns: Expanded arguments in the same order
Return type: tuple
-
init
(basedir, config, sourcedir, targetdir, cwd='', commit=True)[source]¶ Init project structure and configuration from given arguments
Parameters: - basedir (string) – Project base directory used to prepend relative paths. If empty or equal to ‘.’, it will be filled with current directory path.
- config (string) – Settings file path.
- sourcedir (string) – Source directory path.
- targetdir (string) – Compiled files target directory path.
Keyword Arguments: - cwd (string) – Current directory path to prepend base dir if empty.
- commit (bool) –
If
False
, directory structure and settings file won’t be created.
Returns: A dict containing expanded given paths.
Return type: dict
-
valid_paths
(*args)[source]¶ Validate that given paths are not the same.
Parameters: (string) – Path to validate. Raises: boussole.exceptions.SettingsInvalidError
– If there is more than one occurence of the same path.Returns: True
if paths are validated.Return type: bool
-