diff options
author | 2016-06-12 14:19:35 +0000 | |
---|---|---|
committer | 2018-07-06 22:22:10 -0700 | |
commit | ce208b929ff66552b9833bf7ad7820cb13b760b4 (patch) | |
tree | 898359e53e61f91a6939eed15121ae8df95e85cf | |
parent | Created the send-key function (diff) | |
download | gentoo-keys-ce208b929ff66552b9833bf7ad7820cb13b760b4.tar.gz gentoo-keys-ce208b929ff66552b9833bf7ad7820cb13b760b4.tar.bz2 gentoo-keys-ce208b929ff66552b9833bf7ad7820cb13b760b4.zip |
gkeys/actions: Update the update-seed function
Update descriptions.
Update operations to current library code usage.
<rebase edit>
Replace print() use with self.output(). Expand commit message
</edit Brian Dolbec>
-rw-r--r-- | gkeys/gkeys/actions.py | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py index e495984..3450277 100644 --- a/gkeys/gkeys/actions.py +++ b/gkeys/gkeys/actions.py @@ -114,41 +114,23 @@ class Actions(ActionBase): category_success, messages = self.updateseed(custom_args) category_msgs.extend(messages) return (True, category_msgs) - print("Fetching seeds for %s category.\n" %args.category) - success, old_gkeys = self.listseed(args) + self.output('', "Fetching seeds for %s category.\n" %args.category) fetch_success, fetch_messages = self.fetchseed(args) self.seeds = None if fetch_success is not True: success = False messages = fetch_messages - print("Fetch failed.\n") + self.output('', "Fetch failed.\n") else: - print("Fetch succeeded.\n") - print("Installing or Refreshing keys for %s category." %args.category) + self.output('', "Fetch succeeded.\n") + self.output('', "Installing or Refreshing keys for %s category." %args.category) install_success, install_messages = self.installkey(args) if install_success is not True: - print("Update failed.\n") + self.output('', "Update failed.\n") success = False else: - print("Update succeeded.\n") - messages = fetch_messages + [" Update operation:"] + [install_messages] - success, new_gkeys = self.listseed(args) - added_gkeys, changed_gkeys, removed_gkeys = self.seedhandler.compare_seeds(old_gkeys, new_gkeys) - print("Updated revoked GKeys:") - for gkey in changed_gkeys: - self.output(['', changed_gkeys]) - else: - print("No GKeys were revoked") - print("Added GKeys:") - for gkey in added_gkeys: - self.output(['', added_gkeys]) - else: - print("No GKeys were added") - print("Removed GKeys:") - for gkey in removed_gkeys: - self.output(['', added_gkeys]) - else: - print("No GKeys were removed") + self.output('', "Update succeeded.\n") + messages = fetch_messages + ["Update operation:"] + [install_messages] return (success, messages) def addseed(self, args): |