Conditions | 6 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6.0702 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | 1 | import os |
|
59 | 1 | @classmethod |
|
60 | def generate(cls): |
||
61 | 1 | root = Path.cwd() |
|
62 | |||
63 | 1 | if len(os.listdir()) >= 3: |
|
64 | log.warning("A project already exists: %s", root) |
||
65 | return False |
||
66 | |||
67 | 1 | with root.joinpath(".gitignore").open('w') as stream: |
|
68 | 1 | stream.write(GITIGNORE.strip() + '\n') |
|
69 | 1 | with root.joinpath("Makefile").open('w') as stream: |
|
70 | 1 | stream.write(MAKEFILE.strip() + '\n') |
|
71 | |||
72 | 1 | docs = Path("docs") |
|
73 | 1 | docs.mkdir(parents=True, exist_ok=True) |
|
74 | |||
75 | 1 | with docs.joinpath("index.html").open('w') as stream: |
|
76 | 1 | stream.write(INDEX.strip() + '\n') |
|
77 | 1 | with docs.joinpath("osmerge.geojson").open('w') as stream: |
|
78 | 1 | stream.write(GEOJSON.strip() + '\n') |
|
79 | |||
80 | return True |
||
81 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.