aboutsummaryrefslogtreecommitdiffstats
path: root/_offlineimap/offlineimap.py
diff options
context:
space:
mode:
Diffstat (limited to '_offlineimap/offlineimap.py')
-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()