[Tutor] doc string format ?

dave selby dave6502 at googlemail.com
Sun Jun 8 10:54:13 CEST 2008


Hi All,

I am trying to improve my code quality and have started using doc
strings. What format do you guys use for your doc strings ?
I have 'made up' the following general format ...

Cheers

Dave



def gen_vhost(kmotion_dir):
    """
    Generate the kmotion vhost file from vhost_template expanding %directory%
    strings to their full paths as defined in kmotion.rc

    arguments :
    kmotion_dir ... the 'root' directory of kmotion

    exceptions:
    exit ... if kmotion.rc cannot be read

    returns:
    """
    parser = ConfigParser.SafeConfigParser()
    parsed = parser.read('%s/core/kmotion.rc' % kmotion_dir)
    try:
        images_dbase_dir = parser.get('dirs', 'images_dbase_dir')
        port = parser.get('misc', 'port')
        LDAP_enabled = parser.get('LDAP', 'enabled') in ['true',
'True',  'yes',  'Yes']
        LDAP_url = parser.get('LDAP', 'AuthLDAPUrl')
    except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
............
-- 

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


More information about the Tutor mailing list