aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-09-09 17:00:42 +0800
committerAaron LI <aaronly.me@outlook.com>2016-09-09 17:00:42 +0800
commit17776601554011319e824e5815a3fe4597d344da (patch)
treeae8915d23c9c047707c0ff5f457aad71d9846286
parent50ce0cf0e0933312a5b51eace26d5821379e731d (diff)
downloaddotfiles-17776601554011319e824e5815a3fe4597d344da.tar.bz2
offlineimap.py: remove unused code and fix errors/warnings
-rwxr-xr-x_offlineimap/offlineimap.py21
1 files changed, 4 insertions, 17 deletions
diff --git a/_offlineimap/offlineimap.py b/_offlineimap/offlineimap.py
index 9a60d99..e34d8a6 100755
--- a/_offlineimap/offlineimap.py
+++ b/_offlineimap/offlineimap.py
@@ -21,11 +21,12 @@
#
# Aaron LI
# Created: 2015-02-02
-# Updated: 2016-01-29
+# Updated: 2016-09-09
#
import os
+import sys
import subprocess
@@ -39,21 +40,6 @@ def mailpasswd(account):
except subprocess.CalledProcessError:
return ''
-# subprocess.check_output() only introduced in python 2.7
-# this version of 'mailpasswd' works with older version of python
-#def mailpasswd(account):
-# account = os.path.basename(account)
-# path = '{0}/.offlineimap/{1}.gpg'.format(os.environ['HOME'], account)
-# args = ['gpg2', '--for-your-eyes-only', '--no-tty',
-# '--quiet', '--batch', '--decrypt', path]
-# proc = subprocess.Popen(args, stdout=subprocess.PIPE)
-# output = proc.communicate()[0].strip()
-# retcode = proc.wait()
-# if retcode == 0:
-# return output
-# else:
-# return ''
-
# If you have several accounts that get checked simultaneously, and you
# use 'gpg-agent', then it will ask for you passphrase for each account.
@@ -72,5 +58,6 @@ def prime_gpg_agent():
i += 1
return ret
-prime_gpg_agent()
+if __name__ == "__main__":
+ prime_gpg_agent()