-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild_settings.py
60 lines (35 loc) · 946 Bytes
/
build_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
head = """
# Settings
## Command line syntax
Read single setting value:
bitdust set <option name>
Write single setting value:
bitdust set <option name> <new value>
List all available settings and its current values:
bitdust set list
## List of options
"""
config_tpl = """### {label} ({typ})
{path}, default value: {default}
{info}
"""
import os
import sys
sys.path.append(sys.argv[1])
from bitdust.main import config
from bitdust.main import settings
settings.init()
fout = open(sys.argv[2], 'w')
fout.write(head)
for name in sorted(config.conf().listAllEntries()):
fout.write(config_tpl.format(
label=config.conf().getLabel(name) or name,
path=name,
typ=config.conf().getTypeLabel(name),
default=config.conf().getDefaultValue(name),
info=config.conf().getInfo(name),
))
sys.stdout.write('.')
sys.stdout.write('\n')
fout.write('\n\n')
fout.close()