diff options
author | drebs <drebs@leap.se> | 2015-05-20 10:58:16 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2015-05-20 11:37:30 -0300 |
commit | d59ac3b5ce713787cd7a46e181f2381de3a8fde2 (patch) | |
tree | e4a6b5e923dab2f93428e2736dcfe83e2f71c4a1 /scripts/db_access/client_side_db.py | |
parent | ec55459fa697f5d8676e16e5fee8a0c0f75c8c2c (diff) |
[feature] ensure reactor stops on client db script
Diffstat (limited to 'scripts/db_access/client_side_db.py')
-rw-r--r-- | scripts/db_access/client_side_db.py | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/scripts/db_access/client_side_db.py b/scripts/db_access/client_side_db.py index 5dd2bd95..1d8d32e2 100644 --- a/scripts/db_access/client_side_db.py +++ b/scripts/db_access/client_side_db.py @@ -214,19 +214,23 @@ def _get_all_docs(soledad): @inlineCallbacks def _main(soledad, km, args): - if args.create_doc: - yield soledad.create_doc({'content': args.create_doc}) - if args.sync: - yield soledad.sync() - if args.get_all_docs: - yield _get_all_docs(soledad) - if args.export_private_key: - yield _export_key(args, km, args.export_private_key, private=True) - if args.export_public_key: - yield _export_key(args, km, args.expoert_public_key, private=False) - if args.export_incoming_messages: - yield _export_incoming_messages(soledad, args.export_incoming_messages) - reactor.stop() + try: + if args.create_doc: + yield soledad.create_doc({'content': args.create_doc}) + if args.sync: + yield soledad.sync() + if args.get_all_docs: + yield _get_all_docs(soledad) + if args.export_private_key: + yield _export_key(args, km, args.export_private_key, private=True) + if args.export_public_key: + yield _export_key(args, km, args.expoert_public_key, private=False) + if args.export_incoming_messages: + yield _export_incoming_messages(soledad, args.export_incoming_messages) + except: + pass + finally: + reactor.stop() if __name__ == '__main__': |