comparison scripts/generate-ini.py @ 6893:d06039dc4ca2

ini: drop insertion of header comments in generated ini files The header comments were kind of redundant and could easily get out of sync. Also, we are moving towards just generating files and don't need this and don't want to maintain it.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 14 Sep 2017 02:08:06 +0200
parents 7292c5976752
children 94f6b23e52d0
comparison
equal deleted inserted replaced
6892:f9b5deab451e 6893:d06039dc4ca2
21 } 21 }
22 22
23 # files to be generated from the mako template 23 # files to be generated from the mako template
24 ini_files = [ 24 ini_files = [
25 ('kallithea/tests/test.ini', 25 ('kallithea/tests/test.ini',
26 '''
27 Kallithea - config for tests:
28 sqlalchemy and kallithea_test.sqlite
29 custom logging
30 ''',
31 { 26 {
32 '[server:main]': { 27 '[server:main]': {
33 'port': '4999', 28 'port': '4999',
34 }, 29 },
35 '[app:main]': { 30 '[app:main]': {
49 'formatter': 'color_formatter_sql', 44 'formatter': 'color_formatter_sql',
50 }, 45 },
51 }, 46 },
52 ), 47 ),
53 ('development.ini', 48 ('development.ini',
54 '''
55 Kallithea - Development config:
56 listening on *:5000
57 sqlite and kallithea.db
58 initial_repo_scan = true
59 debug = true
60 verbose and colorful logging
61 ''',
62 { 49 {
63 '[server:main]': { 50 '[server:main]': {
64 'host': '0.0.0.0', 51 'host': '0.0.0.0',
65 }, 52 },
66 '[app:main]': { 53 '[app:main]': {
89 if mako_marked_up != mako_org: 76 if mako_marked_up != mako_org:
90 print 'writing:', makofile 77 print 'writing:', makofile
91 open(makofile, 'w').write(mako_marked_up) 78 open(makofile, 'w').write(mako_marked_up)
92 79
93 # create ini files 80 # create ini files
94 for fn, desc, settings in ini_files: 81 for fn, settings in ini_files:
95 print 'updating:', fn 82 print 'updating:', fn
96 ini_lines = inifile.expand(mako_marked_up, desc, mako_variable_values, settings) 83 ini_lines = inifile.expand(mako_marked_up, mako_variable_values, settings)
97 open(fn, 'w').write(ini_lines) 84 open(fn, 'w').write(ini_lines)
98 85
99 if __name__ == '__main__': 86 if __name__ == '__main__':
100 main() 87 main()