equal
deleted
inserted
replaced
76 options = SOURCE_TYPES[type].options |
76 options = SOURCE_TYPES[type].options |
77 sconfig = SourceConfiguration(appconfig, options=options) |
77 sconfig = SourceConfiguration(appconfig, options=options) |
78 sconfig.input_config(inputlevel=inputlevel) |
78 sconfig.input_config(inputlevel=inputlevel) |
79 return sconfig |
79 return sconfig |
80 |
80 |
81 def generate_source_config(sconfig): |
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, 'all options for a source should be in the same group' |
86 lgconfig.ini_format(stream, optsbysect[0][1], sys.stdin.encoding) |
86 lgconfig.ini_format(stream, optsbysect[0][1], encoding) |
87 return stream.getvalue() |
87 return stream.getvalue() |
88 |
88 |
89 |
89 |
90 class ServerConfiguration(CubicWebConfiguration): |
90 class ServerConfiguration(CubicWebConfiguration): |
91 """standalone RQL server""" |
91 """standalone RQL server""" |