Use Pango for drawing text in gtkui.draw
[gpodder.git] / doc / config-doc-generator.py
blob9e305f62078ff58f0f59d2a8491fb3fa2a224ebb
1 #!/usr/bin/python
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
9 """
11 import os, os.path
12 import gettext
14 # Enable i18n support
15 domain = 'gpodder'
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' ]:
26 print "!", i
28 settings = config.gPodderSettings.keys()
29 settings.sort()
31 for setting in settings:
32 data = config.gPodderSettings[setting]
33 if len(data) == 2:
34 dtype, default = data
35 desc = 'FIXME: Undocumented'
36 elif len(data) == 3:
37 dtype, default, desc = data
38 else:
39 continue
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('~'), '~' )
49 print '|-'
50 print '|%s || %s || %s || %s' % (setting, dtype, default, desc)
52 print '|}'