From 7a350758db8522afe3b464a8b7b6a059e4b81ae9 Mon Sep 17 00:00:00 2001 From: Jeroen van der Heijden Date: Thu, 9 Mar 2017 13:35:59 +0100 Subject: [PATCH] Update to version 2.0.2 --- ChangeLog-2.0.2 | 4 +++- build_deb.py | 2 ++ main.py | 21 +++++++++++++-------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog-2.0.2 b/ChangeLog-2.0.2 index 47b193c..4d3f040 100644 --- a/ChangeLog-2.0.2 +++ b/ChangeLog-2.0.2 @@ -1,3 +1,5 @@ * Fixed handling the buffer_path argument. (issue #5) - * Fixed error message when an invalid server_name is used. (issue #6) \ No newline at end of file + * Fixed error message when an invalid server_name is used. (issue #6) + + * Update siridb-connector and qpack \ No newline at end of file diff --git a/build_deb.py b/build_deb.py index 49722cf..b454f23 100755 --- a/build_deb.py +++ b/build_deb.py @@ -13,11 +13,13 @@ CHANGELOG_FILE = 'ChangeLog' + def _get_changelog(version): with open('ChangeLog-{}'.format(version), 'r') as f: content = f.read() return content + def _get_distribution(): '''Returns distribution code name. (Ubuntu)''' proc = subprocess.Popen(['lsb_release', '-c'], stdout=subprocess.PIPE) diff --git a/main.py b/main.py index 61d42be..d6a7515 100755 --- a/main.py +++ b/main.py @@ -43,6 +43,7 @@ local_siridb_info = None remote_siridb_info = None + def check_valid_dbname(dbname): if not isinstance(dbname, str): raise ValueError( @@ -103,9 +104,9 @@ def create_database( 'w', encoding='utf-8') as f: f.write(DEFAULT_CONFIG.format( - comment_buffer_path= - '# ' if _config['buffer_path'] == dbpath else '', - **_config)) + comment_buffer_path='# ' + if _config['buffer_path'] == dbpath else '', + **_config)) db_obj = [ 1, # shema version @@ -425,7 +426,9 @@ def join_database(): db = menu( title='Database', - options=Options([{'option': str(i), 'text': s} for i, s in enumerate(remote_siridb_info.dblist)]), + options=Options([ + {'option': str(i), 'text': s} + for i, s in enumerate(remote_siridb_info.dblist)]), default='0') dbname = remote_siridb_info.dblist[int(db)] @@ -524,13 +527,15 @@ def create_joined_database(dbpath, buffer_path, pool, new_pool, action_str): new_pool, allow_retry=True) + def get_time_precision(s): _map = ['s', 'ms', 'us', 'ns'] return _map.index(s) def get_duration(tp, duration): - return duration if isinstance(duration, int) else DURATIONS[duration][0] * (1000**tp) + return duration if isinstance(duration, int) \ + else DURATIONS[duration][0] * (1000**tp) def create_and_register_server(dbname, @@ -597,7 +602,7 @@ def rollback(*args): 1, 'All servers must have status {!r} ' 'before we can continue. As least {!r} has status {!r}' - .format(expected, srv[0], srv[1])); + .format(expected, srv[0], srv[1])) asyncio.get_event_loop().run_until_complete(load_database( dbpath, @@ -830,7 +835,8 @@ def form_create_new_database(): ]), default='ms') - duration_options = [{'option': k, 'text': v[1]} for k, v in DURATIONS.items()] + duration_options = [ + {'option': k, 'text': v[1]} for k, v in DURATIONS.items()] duration_num = menu( title='Number (float and integer) sharding duration', @@ -975,7 +981,6 @@ def parse_create_replica_or_pool(args): else: pool = len(result['pools']) - dbconfig = siri.query('show {}'.format(','.join(DBPROPS))) except Exception as e: quit_manage(1, e)