equal
deleted
inserted
replaced
80 |
80 |
81 def generate_source_config(sconfig, encoding=sys.stdin.encoding): |
81 def generate_source_config(sconfig, encoding=sys.stdin.encoding): |
82 """serialize a repository source configuration as text""" |
82 """serialize a repository source configuration as text""" |
83 stream = StringIO() |
83 stream = StringIO() |
84 optsbysect = list(sconfig.options_by_section()) |
84 optsbysect = list(sconfig.options_by_section()) |
85 assert len(optsbysect) == 1, 'all options for a source should be in the same group' |
85 assert len(optsbysect) == 1, ( |
|
86 'all options for a source should be in the same group, got %s' |
|
87 % [x[0] for x in optsbysect]) |
86 lgconfig.ini_format(stream, optsbysect[0][1], encoding) |
88 lgconfig.ini_format(stream, optsbysect[0][1], encoding) |
87 return stream.getvalue() |
89 return stream.getvalue() |
88 |
90 |
89 |
91 |
90 class ServerConfiguration(CubicWebConfiguration): |
92 class ServerConfiguration(CubicWebConfiguration): |