| Trees | Index | Help |
|---|
| Package Peapod :: Module peapod :: 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 = peapodConf()
print config.defaults["savepath"]
for feed in config.feedlist:
print feed[""]
print feed["url"]
print feed["options"]["savepath"]
| Method Summary | |
|---|---|
__init__(self)
| |
Creates a default configuration file in ~/.peapod/peapod.xml, which provides a sample podcast subscription. | |
Extract text from the xml tags read in. | |
Check for commandline arguments. | |
Extract value from an option element. | |
| Class Variable Summary | |
|---|---|
dict |
defaults = {'verbose': 0, 'ipodpath': '/media/ipod', 'te...
|
dict |
feedlist = {}
|
int |
parsed = 0 |
| Method Details |
|---|
create_default_config(self)Creates a default configuration file 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_commandline(self)Check for commandline arguments. Uses getopt for argument processing long and short style 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
|
feedlist
|
parsed
|
| Trees | Index | Help |
|---|
| Generated by Epydoc 2.1 on Sun Aug 12 06:40:33 2007 | http://epydoc.sf.net |