Conventions » History » Version 2
Thomas Mielke, 02/15/2020 03:45 PM
1 | 1 | Alexander Blum | # Conventions |
---|---|---|---|
2 | 1 | Alexander Blum | |
3 | 1 | Alexander Blum | ## Codingstyle |
4 | 1 | Alexander Blum | |
5 | 1 | Alexander Blum | * [PEP 8 compliance][pep8] |
6 | 1 | Alexander Blum | * line length: 80 columns |
7 | 1 | Alexander Blum | * intendation: 4 spaces |
8 | 1 | Alexander Blum | * pinning of module versions |
9 | 1 | Alexander Blum | * relative filepaths, where possible |
10 | 1 | Alexander Blum | |
11 | 1 | Alexander Blum | [pep8]: https://www.python.org/dev/peps/pep-0008 |
12 | 1 | Alexander Blum | |
13 | 1 | Alexander Blum | ## Docstrings |
14 | 1 | Alexander Blum | |
15 | 1 | Alexander Blum | * [Google Style Python Docstrings][docstrings] |
16 | 1 | Alexander Blum | |
17 | 2 | Thomas Mielke | [docstrings]: https://redmine.c3s.cc/projects/collecting_society/wiki/Conventions |
18 | 1 | Alexander Blum | |
19 | 1 | Alexander Blum | ## Branching |
20 | 1 | Alexander Blum | |
21 | 1 | Alexander Blum | * [A successful Git branching model][nvie] |
22 | 1 | Alexander Blum | * master branch (= release) |
23 | 1 | Alexander Blum | * develop branch (integration of feature branches) |
24 | 1 | Alexander Blum | * feature branches (for each feature) |
25 | 1 | Alexander Blum | |
26 | 1 | Alexander Blum | [nvie]: http://nvie.com/posts/a-successful-git-branching-model/ |
27 | 1 | Alexander Blum | |
28 | 1 | Alexander Blum | ## Filestructure |
29 | 1 | Alexander Blum | |
30 | 1 | Alexander Blum | ~~~ |
31 | 1 | Alexander Blum | ├── <MODULE> # <MODULE> name |
32 | 1 | Alexander Blum | │ │ |
33 | 1 | Alexander Blum | │ ├── locale # files for translations |
34 | 1 | Alexander Blum | │ │ ├── <LANG> # files for translation language <LANG> |
35 | 1 | Alexander Blum | │ │ │ └── LC_MESSAGES |
36 | 1 | Alexander Blum | │ │ │ ├── <MODULE>.mo # machine readable list of messages for <MODULE> |
37 | 1 | Alexander Blum | │ │ │ └── <MODULE>.po # human editable list of messages for <MODULE> |
38 | 1 | Alexander Blum | │ │ └── MODULE.pot # template file with message identifiers for <MODULE> |
39 | 1 | Alexander Blum | │ │ |
40 | 1 | Alexander Blum | │ ├── models # files for tryton model wrapper |
41 | 1 | Alexander Blum | │ │ ├── __init__.py # imports of model wrapper |
42 | 1 | Alexander Blum | │ │ └── MODEL.py # wrapper for tryton <MODEL> (__name__) |
43 | 1 | Alexander Blum | │ │ |
44 | 1 | Alexander Blum | │ ├── services # files for services (reusable, special purpose code) |
45 | 1 | Alexander Blum | │ │ ├── __init__.py # imports for services |
46 | 1 | Alexander Blum | │ │ └── SERVICE.py # <SERVICE> name |
47 | 1 | Alexander Blum | │ │ |
48 | 1 | Alexander Blum | │ ├── static # files for static content |
49 | 1 | Alexander Blum | │ │ ├── css # files for cascading stylesheets |
50 | 1 | Alexander Blum | │ │ ├── font # files for fonts |
51 | 1 | Alexander Blum | │ │ ├── img # files for images |
52 | 1 | Alexander Blum | │ │ ├── js # files for javascript |
53 | 1 | Alexander Blum | │ │ └── lib # files for libraries (e.g. bundles of css/font/img/js) |
54 | 1 | Alexander Blum | │ │ |
55 | 1 | Alexander Blum | │ ├── templates # files for chameleon templates |
56 | 1 | Alexander Blum | │ │ ├── debug # files for templates for debug views |
57 | 1 | Alexander Blum | │ │ ├── deform # files for templates for deform (overwriting default templates) |
58 | 1 | Alexander Blum | │ │ ├── mail # files for templates for mails |
59 | 1 | Alexander Blum | │ │ ├── widgets # files for templates for widgets (reusable content) |
60 | 1 | Alexander Blum | │ │ ├── <VIEWCLASS> # files for templates for <VIEWCLASS> |
61 | 1 | Alexander Blum | │ │ │ └── <VIEWMETHOD>.pt # template for <VIEWMETHOD> of <VIEWCLASS> |
62 | 1 | Alexander Blum | │ │ └── macros.pt # chameleon macros (reusable template snippets) |
63 | 1 | Alexander Blum | │ │ |
64 | 1 | Alexander Blum | │ ├── tests # files for tests |
65 | 1 | Alexander Blum | │ │ ├── pageobjects # files for page object pattern for integration tests |
66 | 1 | Alexander Blum | │ │ │ └── <FORM>.py # page object for <FORM> |
67 | 1 | Alexander Blum | │ │ ├── functional # files for functional tests (webtest) |
68 | 1 | Alexander Blum | │ │ │ └── <FUNCTION>.py # functional tests for <FUNCTION> |
69 | 1 | Alexander Blum | │ │ ├── integration # files for integration tests (webdriver) |
70 | 1 | Alexander Blum | │ │ │ └── <USECASE>.py # integraion tests for <USECASE> |
71 | 1 | Alexander Blum | │ │ └── unit # files for unit tests (unittest), resembles filestructure |
72 | 1 | Alexander Blum | │ │ ├── models # files for unit tests for tryton models |
73 | 1 | Alexander Blum | │ │ │ └── <MODEL>.py # unit tests for <MODEL> |
74 | 1 | Alexander Blum | │ │ ├── services # files for unit tests for services |
75 | 1 | Alexander Blum | │ │ │ └── <SERVICE>.py # unit tests for <USECASE> |
76 | 1 | Alexander Blum | │ │ ├── views # files for unit tests for views |
77 | 1 | Alexander Blum | │ │ │ └── <VIEWCLASS>.py # unit tests for <VIEWCLASS> |
78 | 1 | Alexander Blum | │ │ ├── helpers.py # unit tests for helpers |
79 | 1 | Alexander Blum | │ │ └── resources.py # unit tests for resources |
80 | 1 | Alexander Blum | │ │ |
81 | 1 | Alexander Blum | │ ├── views # files for views |
82 | 1 | Alexander Blum | │ │ ├── api # files for api views |
83 | 1 | Alexander Blum | │ │ │ └── <API>.py # views for <API> |
84 | 1 | Alexander Blum | │ │ ├── forms # files for form controller |
85 | 1 | Alexander Blum | │ │ │ └── <FORM>.py # form controller for <FORM> |
86 | 1 | Alexander Blum | │ │ ├── widgets # files for widgets |
87 | 1 | Alexander Blum | │ │ │ └── <WIDGET>.py # <WIDGET> name |
88 | 1 | Alexander Blum | │ │ └── <VIEWCLASS>.py # views for <VIEWCLASS> |
89 | 1 | Alexander Blum | │ │ |
90 | 1 | Alexander Blum | │ ├── includes.py # includes for resources, registry and views (plugin system) |
91 | 1 | Alexander Blum | │ └── resources.py # resources for traversal |
92 | 1 | Alexander Blum | │ |
93 | 1 | Alexander Blum | ├── README.rst # readme |
94 | 1 | Alexander Blum | ├── CHANGELOG.rst # changelog |
95 | 1 | Alexander Blum | ├── COPYRIGHT.rst # copyright note |
96 | 1 | Alexander Blum | ├── LICENSE-<LICENCSE>.rst # <LICENSE> in full text |
97 | 1 | Alexander Blum | ├── MANIFEST.in # manifest for distribution package |
98 | 1 | Alexander Blum | ├── setup.py # setup for distribution package |
99 | 1 | Alexander Blum | ├── development.ini # configuration of development environment |
100 | 1 | Alexander Blum | ├── production.ini # configuration of production environment |
101 | 1 | Alexander Blum | └── testing.ini # configuration of testing environment |
102 | 1 | Alexander Blum | ~~~ |
103 | 1 | Alexander Blum | |
104 | 1 | Alexander Blum | ## Important Files |
105 | 1 | Alexander Blum | |
106 | 1 | Alexander Blum | ~~~ |
107 | 1 | Alexander Blum | └── collecting_society_portal |
108 | 1 | Alexander Blum | │ |
109 | 1 | Alexander Blum | ├── models |
110 | 1 | Alexander Blum | │ └── base.py # base class for model wrappers, db connection handling |
111 | 1 | Alexander Blum | │ |
112 | 1 | Alexander Blum | ├── templates |
113 | 1 | Alexander Blum | │ ├── backend39.pt # template 'backend39' for the backend with 2 columns |
114 | 1 | Alexander Blum | │ ├── backend363.pt # template 'backend363' for the backend with 3 columns |
115 | 1 | Alexander Blum | │ ├── base.pt # base template including headers and main slots |
116 | 1 | Alexander Blum | │ └── frontend.pt # template 'frontend' for the frontend |
117 | 1 | Alexander Blum | │ |
118 | 1 | Alexander Blum | ├── tests |
119 | 1 | Alexander Blum | │ ├── pageobjects |
120 | 1 | Alexander Blum | │ │ ├── base.py # base page element |
121 | 1 | Alexander Blum | │ │ ├── elements.py # elements (mapper of deform objects) |
122 | 1 | Alexander Blum | │ │ └── objects.py # deform form (parser of deform form object) |
123 | 1 | Alexander Blum | │ ├── __init__.py # preparations for each test run |
124 | 1 | Alexander Blum | │ ├── base.py # base class for tests, testserver/-client handling |
125 | 1 | Alexander Blum | │ └── config.py # configuration of tests |
126 | 1 | Alexander Blum | │ |
127 | 1 | Alexander Blum | ├── views |
128 | 1 | Alexander Blum | │ ├── forms # files for formcontroller |
129 | 1 | Alexander Blum | │ │ ├── __init__.py # definition of default form renderer |
130 | 1 | Alexander Blum | │ │ └── base.py # base class for form controller, deform helper classes |
131 | 1 | Alexander Blum | │ └── base.py # base class for views |
132 | 1 | Alexander Blum | │ |
133 | 1 | Alexander Blum | ├── __init__.py # main function, creation of app |
134 | 1 | Alexander Blum | ├── config.py # configuration of app |
135 | 1 | Alexander Blum | └── helpers.py # helpers for templates |
136 | 1 | Alexander Blum | ~~~ |