Conventions » History » Version 1

Version 1/5 - Next » - Current version
Alexander Blum, 10/05/2019 08:10 PM


Conventions

Codingstyle

  • PEP 8 compliance
    • line length: 80 columns
    • intendation: 4 spaces
  • pinning of module versions
  • relative filepaths, where possible

Docstrings

Branching

Filestructure

├── <MODULE>                         # <MODULE> name
│   │
│   ├── locale                       # files for translations
│   │   ├── <LANG>                   # files for translation language <LANG>
│   │   │   └── LC_MESSAGES 
│   │   │       ├── <MODULE>.mo      # machine readable list of messages for <MODULE>
│   │   │       └── <MODULE>.po      # human editable list of messages for <MODULE>
│   │   └── MODULE.pot               # template file with message identifiers for <MODULE>
│   │
│   ├── models                       # files for tryton model wrapper
│   │   ├── __init__.py              # imports of model wrapper
│   │   └── MODEL.py                 # wrapper for tryton <MODEL> (__name__)
│   │
│   ├── services                     # files for services (reusable, special purpose code)
│   │   ├── __init__.py              # imports for services
│   │   └── SERVICE.py               # <SERVICE> name
│   │
│   ├── static                       # files for static content
│   │   ├── css                      # files for cascading stylesheets
│   │   ├── font                     # files for fonts
│   │   ├── img                      # files for images
│   │   ├── js                       # files for javascript
│   │   └── lib                      # files for libraries (e.g. bundles of css/font/img/js)
│   │
│   ├── templates                    # files for chameleon templates
│   │   ├── debug                    # files for templates for debug views
│   │   ├── deform                   # files for templates for deform (overwriting default templates)
│   │   ├── mail                     # files for templates for mails
│   │   ├── widgets                  # files for templates for widgets (reusable content)
│   │   ├── <VIEWCLASS>              # files for templates for <VIEWCLASS>
│   │   │   └── <VIEWMETHOD>.pt      # template for <VIEWMETHOD> of <VIEWCLASS>
│   │   └── macros.pt                # chameleon macros (reusable template snippets)
│   │
│   ├── tests                        # files for tests
│   │   ├── pageobjects              # files for page object pattern for integration tests
│   │   │   └── <FORM>.py            # page object for <FORM>
│   │   ├── functional               # files for functional tests (webtest)
│   │   │   └── <FUNCTION>.py        # functional tests for <FUNCTION>
│   │   ├── integration              # files for integration tests (webdriver)
│   │   │   └── <USECASE>.py         # integraion tests for <USECASE>
│   │   └── unit                     # files for unit tests (unittest), resembles filestructure
│   │       ├── models               # files for unit tests for tryton models
│   │       │   └── <MODEL>.py       # unit tests for <MODEL>
│   │       ├── services             # files for unit tests for services
│   │       │   └── <SERVICE>.py     # unit tests for <USECASE>
│   │       ├── views                # files for unit tests for views
│   │       │   └── <VIEWCLASS>.py   # unit tests for <VIEWCLASS>
│   │       ├── helpers.py           # unit tests for helpers
│   │       └── resources.py         # unit tests for resources
│   │
│   ├── views                        # files for views
│   │   ├── api                      # files for api views
│   │   │   └── <API>.py             # views for <API>
│   │   ├── forms                    # files for form controller
│   │   │   └── <FORM>.py            # form controller for <FORM>
│   │   ├── widgets                  # files for widgets
│   │   │   └── <WIDGET>.py          # <WIDGET> name
│   │   └── <VIEWCLASS>.py           # views for <VIEWCLASS>
│   │
│   ├── includes.py                  # includes for resources, registry and views (plugin system)
│   └── resources.py                 # resources for traversal
│
├── README.rst                       # readme
├── CHANGELOG.rst                    # changelog
├── COPYRIGHT.rst                    # copyright note
├── LICENSE-<LICENCSE>.rst           # <LICENSE> in full text
├── MANIFEST.in                      # manifest for distribution package
├── setup.py                         # setup for distribution package
├── development.ini                  # configuration of development environment
├── production.ini                   # configuration of production environment
└── testing.ini                      # configuration of testing environment

Important Files

└── collecting_society_portal
    │
    ├── models
    │   └── base.py                  # base class for model wrappers, db connection handling
    │
    ├── templates 
    │   ├── backend39.pt             # template 'backend39' for the backend with 2 columns
    │   ├── backend363.pt            # template 'backend363' for the backend with 3 columns
    │   ├── base.pt                  # base template including headers and main slots
    │   └── frontend.pt              # template 'frontend' for the frontend
    │
    ├── tests 
    │   ├── pageobjects
    │   │   ├── base.py              # base page element
    │   │   ├── elements.py          # elements (mapper of deform objects)
    │   │   └── objects.py           # deform form (parser of deform form object)
    │   ├── __init__.py              # preparations for each test run
    │   ├── base.py                  # base class for tests, testserver/-client handling
    │   └── config.py                # configuration of tests
    │
    ├── views
    │   ├── forms                    # files for formcontroller
    │   │   ├── __init__.py          # definition of default form renderer
    │   │   └── base.py              # base class for form controller, deform helper classes
    │   └── base.py                  # base class for views
    │
    ├── __init__.py                  # main function, creation of app
    ├── config.py                    # configuration of app
    └── helpers.py                   # helpers for templates