Menu:

Our used python code style

Our source code style based on PEP-8.

Some points:

  • max. line length: 110 characters.
  • No Python shebang! (Only needed in the dispatcher files)
  • Source code encoding always utf-8 (lower)
  • copyleft info:
    • copyleft not copyright ;)
    • always by "the PyLucid team" (New authors should be inserted in AUTHORS file!)
    • you can insert author info (like "based on sourcecode by..." or "created by...") into the normal header DocString.
  • We use GPL v3 or above
  • no TABs, use only 4 spaced to indent
  • Lineendings
    • We use linux like line endings: "\n"
    • SVN property svn:eol-style should be set to LF

The source code header should look like this:

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
# coding: utf-8

"""
    the Headline
    ~~~~~~~~~~~~

    Some Info about the file.

    Last commit info:
    ~~~~~~~~~~~~~~~~~
    $LastChangedDate$
    $Rev$
    $Author:$

    :copyleft: 2009 by the PyLucid team, see AUTHORS for more details.
    :license: GNU GPL v3 or above, see LICENSE for more details.
"""

...

↑ PyDev code formatter settings  #

Window -> Preferences -> Pydev -> Editor -> Code Style -> Code Formatter

PyDev code formatter settings

0 comments for 'code style':
    there exist no comment for 'code style'
Leave a comment
tag navi developing
Fork me on GitHub