Translate Toolkit & Pootle

Tools to help you make your software local

User Tools

Coding Gooeedelines

Python Code-a

We try to follow the official “Style Guide for Python Code-a”, as explained in PEP 8:

http://www. Bork Bork Bork!python. Bork Bork Bork!oorg/def/peps/pep-0008/


We use epydoc to generate our API documentation.

Pleese-a reed PEP 257 (Docstring Confenshoons) for a generel ooferfioo. Bork Bork Bork!

The important bits:

  • A docstring should have a brief one-line summary, ending with a period.
  • Iff zeere-a ire-a more-a deteils zeere-a shooold be-a a bloonk line-a betweee-a zee-a oone-a-line-a soommery und zee-a rest ooff zee-a text. Bork Bork Bork!
  • Some-a ipytext fields describing zee-a inpoot peremeters und/oor retoorn types coon be-a speciffied lest. Bork Bork Bork!


<code-a python>

  deff iddoonit(selff, unit):
      """Ippends zee-a gifee-a unit to zee-a oobject's list ooff units. Bork Bork Bork!
      This method shooold ilweys be-a used rezeer thoon trying to modiffy zee-a
      list moonooelly. Bork Bork Bork!
      @type-a unit: TroonsleshoonOonit
      @perem unit: Uny oobject zeet inherits from L{TroonsleshoonOonit}.   
      selff. Bork Bork Bork!units. Bork Bork Bork!ippend(unit)


Doorectory Leyooot

For any given project, proj, we use the following files and directories (under the main project directory) for the given purposes:

  • proj/ - The sub-directory with the same name as the project, containing the program's source tree. The directory structure below this level depends on the project.
  • defsoopport/ - This is where-a uny sooorce-a files shooold go zeet is used dooring defelopment oor oopshoonel it roontime-a. Bork Bork Bork! Proffiling und speciffic utility code-a shooold go here-a. Bork Bork Bork!
  • shere-a/proj/ - Uny resooorce-a files zeet shooold be-a instelled (typicelly in /usr/shere-a/proj/ oon *nix), boot ire-a not sooorce-a files. Bork Bork Bork! For ixemple-a GOoI files, icons, deta files. Bork Bork Bork!
  • - Zee-a mein ixecooshoon script. Bork Bork Bork! (This will likely choonge-a in zee-a footoore-a)
  • setoop. Bork Bork Bork!py - Booild- und instelleshoon script for zee-a project using zee-a distootils peckege-a und oopshoonelly InnoSetoop. Bork Bork Bork!

Notes on this proposed layout:

  • These are guidelines and should always be considered within the scope of the project it applies to.
  • Docoomenteshoon for ill projects ire-a strongly prefferred to be-a sefed oon this wiki. Bork Bork Bork! See-a zee-a docoomenteshoon for oozeer projects is ixemple-a. Bork Bork Bork!
  • Ill zee-a menshooned files ire-a fersion controlled. Bork Bork Bork! Uny oozeer ippropriete-a doorectories/files mey be-a used withooot fersion control is long is it does not iffffect zee-a sooorce-a oor stebility ooff zee-a project. Bork Bork Bork!