Package Peapod :: Module peapod :: Class peapodConf
[show private | hide private]
[frames | no frames]

Class peapodConf


Class to manage the configuration for peapod.  Handles command-line
arguments, configuration file options and hardcoded defaults.  Options may
be global or specific to a known feed.

The configuration file is stored as an xml file.  If one is not present, a
default can be created.

Use :

config = getConfig()
print config.options["savepath"]
for feed in config.feedlist:
    print feed[""]
    print feed["url"]
    print feed["options"]["savepath"]

Method Summary
  __init__(self, cmd_line)
  create_default_config(self)
Creates a default configuration file, usually in ~/.peapod/peapod.xml, which provides a sample podcast subscription.
  get_text(self, nodelist)
Extract text from the xml tags read in.
  parse_configfile(self)
Read configuration file and use contents to override default options.
  process_options(self, element, opt)
Extract value from an option element.

Class Variable Summary
dict defaults = {'verbose': 0, 'ipodpath': '/media/ipod', 'te...

Method Details

create_default_config(self)

Creates a default configuration file, usually in ~/.peapod/peapod.xml, which provides a sample podcast subscription.

get_text(self, nodelist)

Extract text from the xml tags read in. Data type is not known at this point.

parse_configfile(self)

Read configuration file and use contents to override default options.

process_options(self, element, opt)

Extract value from an option element. Data type is assumed from the string content. Extracted values are inserted into opt as dictionary elements.

Class Variable Details

defaults

Type:
dict
Value:
{'ID3encoding': None,
 'addnew': 0,
 'bandwidth': 0,
 'bittorrent': 1,
 'catchup': 0,
 'configfile': 'peapod.xml',
 'copynew': 0,
 'dryrun': 0,
...                                                                    

Generated by Epydoc 2.1 on Sun Feb 13 06:25:12 2011 http://epydoc.sf.net