2 """ Generates a mediawiki-compatible table of all the gPodder settings
4 Usage: doc/config-doc-generator.py > some-file.txt
5 Fancy usage: LANG=fr_FR.UTF-8 PYTHONPATH=src/ LOCALEDIR=data/locale/ \
6 doc/config-doc-generator.py > some-file.txt
8 Poke nikosapi <me@nikosapi.org> if this doesn't work
16 locale_dir
= os
.environ
.get('LOCALEDIR', '/usr/share/locale/')
17 locale_dir
= os
.path
.abspath( os
.path
.normpath( locale_dir
))
18 gettext
.bindtextdomain( domain
, locale_dir
)
19 gettext
.textdomain( domain
)
20 gettext
.install(domain
, locale_dir
, unicode=True)
22 from gpodder
import config
24 print '{| border="1" cellpadding="2"'
25 for i
in [ 'Name', 'Type', 'Default', 'Description' ]:
28 settings
= config
.gPodderSettings
.keys()
31 for setting
in settings
:
32 data
= config
.gPodderSettings
[setting
]
35 desc
= 'FIXME: Undocumented'
37 dtype
, default
, desc
= data
41 if dtype
== str and default
== '':
42 default
= '<i>empty string</i>'
44 dtype
= dtype
.__name
__
46 if setting
== 'download_dir':
47 default
= default
.replace( os
.path
.expanduser('~'), '~' )
50 print '|%s || %s || %s || %s' % (setting
, dtype
, default
, desc
)