Dear Wiki user, You have subscribed to a wiki page or wiki category on "Freevo Wiki" for change notification.
The following page has been changed by 134.102.218.42: http://freevo.sourceforge.net/cgi-bin/moin.cgi/CodingStandard ------------------------------------------------------------------------------ @@ -1,60 +1,4 @@ -= Writing Python code for Freevo = - - - * Do not use names of builtin functions (IMPORTANT!): - * dir, filter, str, file, etc - - * Always use 4 spaces for indentation. Do not use tabs as that can lead to errors if tabs and spaces are mixed in Python! - - * Do not exceed 80 chars in a line. - - * Use a doc-string for each function. - - * Add documentation in the header of each file explaining what it does. - - * Add internal documentation (#comments) explaining what is done. - - * Use tabnanny.py in the python lib to check for potential tab problems. - * Also use freevo/contrib/developer/chktab.py ! - - * Use `python -t -Wall::PendingDeprecationWarning main.py` to check for potential problems. (deprecated?) - - * P''''''yChecker PleaseUpdate add usage info - - * Strings: Use single-quotes in general (less visual clutter IMHO): - `'Some "doublequoted" text inside a string'` - Use double-quote if you want to use single-quotes inside a string: - `"I can't believe how easy Python is"` - Also use double-quotes for multi-line string constants: - {{{ - """A multi- - line - comment."""}}} - - * Python's linebreak rules are not entirely straight-forward. Most lines cannot be broken without a backslash (\). The exception is for expressions with parenthesis and braces (both kinds), Python doesn't need back-slashes there. I think it looks better with extra parenthesis instead of backslashes. - - * The builtin function "print" is very similar to printf() in C. The major difference is that it automatically adds a linefeed. \n, \r, \t etc can be used for extra spacing. A comma after the print statement prevents the linebreak: - `print 'test',` - It has all the regular %s, %d, %f etc, but usually only %s is needed since it will print any kind of variable after converting it to a string. - -= Getting VIM to play nicely with your python files = - -add this line to your .vimrc: -{{{ -autocmd FileType python set expandtab shiftwidth=4 tabstop=4 -}}} - - - - - - - - - - - - +Moved to new Wiki at [http://freevo.sourceforge.net/cgi-bin/doc/CodingStandard] ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Freevo-wikilog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freevo-wikilog
