diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2017-11-06 17:50:04 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2017-11-06 17:50:04 +0100 |
| commit | 439c8b273b6203af49242baf18eb7c22b3c4a035 (patch) | |
| tree | 7962cb398c649f4f5fd156ec89449fe041e9fdfd | |
| parent | ce2a2cf9f5b7eb035e326930dcdab5e3018b1d0c (diff) | |
| download | dotfiles-439c8b273b6203af49242baf18eb7c22b3c4a035.tar.gz dotfiles-439c8b273b6203af49242baf18eb7c22b3c4a035.zip | |
simplify offlineimap setup
use xdg_spec instead of silly variable expansion patch
| -rw-r--r-- | config/offlineimap/config (renamed from offlineimap/offlineimaprc) | 2 | ||||
| -rw-r--r-- | config/offlineimap/offlineimap.py (renamed from offlineimap/offlineimap.py) | 0 | ||||
| -rw-r--r-- | config/offlineimap/offlineimap@.service (renamed from offlineimap/offlineimap@.service) | 0 | ||||
| -rw-r--r-- | offlineimap/expandvars.patch | 13 | ||||
| -rwxr-xr-x | setup.py | 33 |
5 files changed, 2 insertions, 46 deletions
diff --git a/offlineimap/offlineimaprc b/config/offlineimap/config index f514afd..c54570f 100644 --- a/offlineimap/offlineimaprc +++ b/config/offlineimap/config @@ -3,7 +3,7 @@ [general] accounts = FAUMail,MUHQ maxsyncaccounts = 2 -pythonfile = $DOTFILES_LOCATION/offlineimap/offlineimap.py +pythonfile = ~/.config/offlineimap/offlineimap.py [Account FAUMail] localrepository = LocalFAU diff --git a/offlineimap/offlineimap.py b/config/offlineimap/offlineimap.py index 8172d4d..8172d4d 100644 --- a/offlineimap/offlineimap.py +++ b/config/offlineimap/offlineimap.py diff --git a/offlineimap/offlineimap@.service b/config/offlineimap/offlineimap@.service index 67c7e2b..67c7e2b 100644 --- a/offlineimap/offlineimap@.service +++ b/config/offlineimap/offlineimap@.service diff --git a/offlineimap/expandvars.patch b/offlineimap/expandvars.patch deleted file mode 100644 index 3f36fae..0000000 --- a/offlineimap/expandvars.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py -index e61f53d..8da0e19 100644 ---- a/offlineimap/repository/IMAP.py -+++ b/offlineimap/repository/IMAP.py -@@ -378,7 +378,7 @@ class IMAPRepository(BaseRepository): - # 3. read password from file specified in Repository 'remotepassfile' - passfile = self.getconf('remotepassfile', None) - if passfile != None: -- fd = codecs.open(os.path.expanduser(passfile), 'r', 'UTF-8') -+ fd = codecs.open(os.path.expandvars(os.path.expanduser(passfile)), 'r', 'UTF-8') - password = fd.readline().strip() - fd.close() - return password.encode('UTF-8') @@ -55,33 +55,6 @@ def dotfile_loc_helper(quiet): else: return e -def offlineimap_passwd(quiet): - """Write the environment file for the systemd unit""" - res = dotfile_loc_helper(quiet) - if res: - return res - env_file_path = "/etc/systemd/system/offlineimap@fischerling.env" - if not os.path.exists(env_file_path): - try: - subprocess.run(["get_dotfiles_location", ">", - env_file_path]) - except Exception as e: - if isinstance(e, PermissionError): - subprocess.run(["get_dotfiles_location", "|", "sudo", "tee", "-a", - env_file_path, ">", "/dev/null"]) - else: - return e - -def offlineimap_warn(quiet): - """Print a warning about my offlineimap setup""" - - if not quiet: - print("! WARNING !") - print("My offlineimap setup uses a patched version !") - print("The patch can be found at offlineimap/expandvars.patch.") - print("Only proceed if you know what you are doing") - if input("Want to continue ? (y/N) ") not in ["Y","y"]: - exit("Aborting.") # targets are a list of tuples<file name, link destination> and/or functions @@ -125,11 +98,7 @@ targets = { [("config/terminator/config", home_dir + "/.config/terminator/config")], "offlineimap": - [offlineimap_warn, - ("offlineimap/offlineimaprc", home_dir + "/.offlineimaprc"), - ("offlineimap/offlineimap@.service", - "/etc/systemd/system/offlineimap@" + user + ".service"), - offlineimap_passwd], + [("config/offlineimap", home_dir + "/.config/offlineimap")], "msmtp": [("msmtprc", home_dir + "/.msmtprc")], "FAU": |
