Conventions » History » Version 5

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