Skip to content

Instantly share code, notes, and snippets.

@nautilebleu
Created April 13, 2011 08:47
Show Gist options
  • Save nautilebleu/917210 to your computer and use it in GitHub Desktop.
Save nautilebleu/917210 to your computer and use it in GitHub Desktop.
Configuration as nested Python classes
class Conf:
class Map:
special_topics = {
'learning_objects': 'Objets d\'Apprentissage',
'authors': 'Auteur',
'footer_files': 'Barre de navigation',
}
class Package:
skeleton = 'conf/package/skeleton'
class Externals:
shared = 'path/to/shared/on/svn'
theme = 'path/to/theme/on/svn'
class Manifest:
language='fr-FR'
cluster = open('conf/manifest/cluster.xml','r').read()
leaf = open('conf/manifest/item.xml','r').read()
resource = '<resource identifier="" scormtype="sco" href="" type="webcontent"><file href=""/><dependency identifierref="shared_files"/></resource>\n'
class Patterns:
organization = 'org-%s'
cluster = 'cluster-%s'
leaf = 'identifier-%s'
resource = 'resource-%s'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment