3 SCRIPTDIR
= os
.path
.dirname(__file__
)
5 ## Build initial help list
13 f
= open(os
.path
.join(SCRIPTDIR
, 'help.txt'))
17 if not line
or line
.startswith('#'):
18 # skip blank or commented lines
20 elif line
.startswith('>'):
21 help_list
[title
][-1] += ' ' + line
[1:]
28 help_list
[title
][-1] += ' ' + line
31 value
, data
= [x
.strip() for x
in line
.split(':', 1)]
32 if value
.lower() == 'available in':
33 # special setting to create section_known array
34 for section
in data
.split(','):
35 section
= section
.lower().strip()
36 if section
not in settings_known
:
37 settings_known
[section
] = []
38 settings_known
[section
].append(title
)
39 elif value
.lower() == 'mode':
41 elif value
.lower() == 'options':
42 options
[title
] = data
.split('/')
44 help_list
[title
].append(line
)
45 if value
.lower() == 'default setting':
49 ## Done building help list
50 plugins
= [p
for p
in os
.listdir(os
.path
.dirname(SCRIPTDIR
))
51 if not p
.startswith(('__init__', 'togo', 'settings'))]
52 options
['type'] = plugins
57 def getknown(section
):
58 return settings_known
[section
]