Skip to content
Snippets Groups Projects
Commit 0a6b5520 authored by inso's avatar inso
Browse files

Add --profile options

parent 5310a948
No related branches found
No related tags found
No related merge requests found
......@@ -85,7 +85,7 @@ class Application(QObject):
app = cls(qapp, loop, options, app_data, None, None, options.currency, None)
#app.set_proxy()
app.get_last_version()
app.load_profile(app_data.default)
app.load_profile(options.profile)
app.start_coroutines()
app.documents_service = DocumentsService.instanciate(app)
app.switch_language()
......
......@@ -3,5 +3,4 @@ import attr
@attr.s()
class AppData:
profiles = attr.ib(default=attr.Factory(list))
default = attr.ib(convert=str, default="Default Profile")
pass
......@@ -23,6 +23,7 @@ def config_path_factory():
class SakiaOptions:
config_path = attr.ib(default=attr.Factory(config_path_factory))
currency = attr.ib(default="gtest")
profile = attr.ib(default="Default Profile")
_logger = attr.ib(default=attr.Factory(lambda: logging.getLogger('sakia')))
@classmethod
......@@ -49,6 +50,9 @@ class SakiaOptions:
parser.add_option("--currency", dest="currency", default="g1",
help="Select a currency between {0}".format(",".join(ROOT_SERVERS.keys())))
parser.add_option("--profile", dest="profile", default="Default Profile",
help="Select profile to use")
(options, args) = parser.parse_args(argv)
if options.currency not in ROOT_SERVERS.keys():
......@@ -56,6 +60,9 @@ class SakiaOptions:
else:
self.currency = options.currency
if options.profile:
self.profile = options.profile
if options.debug:
self._logger.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(levelname)s:%(module)s:%(funcName)s:%(message)s')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment