Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/gotr
diff options
context:
space:
mode:
authorKjell Braden <afflux.gajim@kjellbraden.de>2011-08-30 23:55:32 +0400
committerKjell Braden <afflux.gajim@kjellbraden.de>2011-08-30 23:55:32 +0400
commitb605838732640621f491bc3d1ed1a1050988c364 (patch)
tree9b6fcd3cb6de9fdfc29aba1d78c08e2ad229a777 /gotr
parent6cfe3ef8b39c2ce347def9ec8585ae3e68efb359 (diff)
make gotr plugin less verbose, fix key regeneration
Diffstat (limited to 'gotr')
-rw-r--r--gotr/otrmodule.py19
-rw-r--r--gotr/ui.py2
2 files changed, 16 insertions, 5 deletions
diff --git a/gotr/otrmodule.py b/gotr/otrmodule.py
index 0a3bb2a..dbbd997 100644
--- a/gotr/otrmodule.py
+++ b/gotr/otrmodule.py
@@ -145,13 +145,23 @@ class GajimOtrAccount(potr.context.Account):
super(GajimOtrAccount, self).__init__(name, PROTOCOL, MMS)
self.keyFilePath = os.path.join(gajim.gajimpaths.data_root, accountname)
+ def dropPrivkey(self):
+ try:
+ os.remove(self.keyFilePath + '.key2')
+ except IOError, e:
+ if e.errno != 2:
+ log.exception('IOError occurred when removing key file for %s',
+ self.name)
+ self.privkey = None
+
def loadPrivkey(self):
try:
with open(self.keyFilePath + '.key2', 'r') as keyFile:
return pickle.load(keyFile)
except IOError, e:
- log.exception('IOError occurred when loading key file for %s',
- self.name)
+ if e.errno != 2:
+ log.exception('IOError occurred when loading key file for %s',
+ self.name)
return None
def savePrivkey(self):
@@ -176,8 +186,9 @@ class GajimOtrAccount(potr.context.Account):
self.getContext(ctx, newCtxCb).setTrust(fpr, trust)
except IOError, e:
- log.exception('IOError occurred when loading fpr file for %s',
- self.name)
+ if e.errno != 2:
+ log.exception('IOError occurred when loading fpr file for %s',
+ self.name)
def saveTrusts(self):
try:
diff --git a/gotr/ui.py b/gotr/ui.py
index dd878b8..9ee090e 100644
--- a/gotr/ui.py
+++ b/gotr/ui.py
@@ -179,7 +179,7 @@ class OtrPluginConfigDialog(GajimPluginConfigDialog):
if active > -1:
account = self.otr_account_store[active][0]
button.set_sensitive(False)
- self.plugin.us[account].privkey = None
+ self.plugin.us[account].dropPrivkey()
self.account_combobox_changed_cb(box, *args)
button.set_sensitive(True)