From f7d263fc2dbcdae70e1b5eecf9e757b2da232153 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 12 May 2016 18:59:24 -0400 Subject: [style] improve readability --- src/leap/mx/couchdbhelper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/leap/mx/couchdbhelper.py b/src/leap/mx/couchdbhelper.py index f17466d..50275ca 100644 --- a/src/leap/mx/couchdbhelper.py +++ b/src/leap/mx/couchdbhelper.py @@ -100,7 +100,8 @@ class ConnectedCouchDB(client.CouchDB): pubkey = None if result["rows"]: doc = result["rows"][0]["doc"] - if "enabled" not in doc or doc["enabled"]: + user_enabled = doc.get('enabled', True) + if user_enabled: uuid = doc["user_id"] if "keys" in doc: pubkey = doc["keys"]["pgp"] -- cgit v1.2.3 From 58c00ee0a92fd7f0bdd4ae930e936ac20fd47e39 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Wed, 18 May 2016 12:19:35 -0400 Subject: [pkg] update to new versioneer json format --- setup.py | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index 7523222..dee8c0b 100644 --- a/setup.py +++ b/setup.py @@ -72,14 +72,20 @@ class freeze_debianver(Command): # unpacked source archive. Distribution tarballs contain a pre-generated copy # of this file. -version_version = '{version}' -full_revisionid = '{full_revisionid}' -""" - templatefun = r""" - -def get_versions(default={}, verbose=False): - return {'version': version_version, - 'full-revisionid': full_revisionid} +import json +import sys + +version_json = ''' +{ + "dirty": false, + "error": null, + "full-revisionid": "FULL_REVISIONID", + "version": "VERSION_STRING" +} +''' # END VERSION_JSON + +def get_versions(): + return json.loads(version_json) """ def initialize_options(self): @@ -94,9 +100,9 @@ def get_versions(default={}, verbose=False): if proceed != "y": print("He. You scared. Aborting.") return - subst_template = self.template.format( - version=VERSION_SHORT, - full_revisionid=VERSION_REVISION) + self.templatefun + subst_template = self.template.replace( + 'VERSION_STRING', VERSION_SHORT).replace( + 'FULL_REVISIONID', VERSION_REVISION) versioneer_cfg = versioneer.get_config_from_root('.') with open(versioneer_cfg.versionfile_source, 'w') as f: f.write(subst_template) -- cgit v1.2.3