From e21453143818389060bf0bd6cfa627c11a63ede5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 11 Aug 2017 05:41:14 +0200 Subject: New upstream release; refresh patches --- debian/patches/0100-config.diff | 81 ++++++++++++++++++++--------------------- 1 file changed, 39 insertions(+), 42 deletions(-) (limited to 'debian/patches/0100-config.diff') diff --git a/debian/patches/0100-config.diff b/debian/patches/0100-config.diff index ce4dba7..8529874 100644 --- a/debian/patches/0100-config.diff +++ b/debian/patches/0100-config.diff @@ -5,47 +5,6 @@ Author: Jörg Frings-Fürst Last-Update: 2014-05-12 --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ -Index: trunk/mwc.py -=================================================================== ---- trunk.orig/mwc.py -+++ trunk/mwc.py -@@ -319,7 +319,7 @@ def pollWebsites(): - - if __name__ == "__main__": - -- configMod = 'config' -+ configMod = '/etc/mwc/mwc-config' - dryrun = None - - try: -@@ -335,9 +335,24 @@ if __name__ == "__main__": - configMod = arg - elif opt in ('-d', '--dry-run'): - dryrun = arg -- -- config = importlib.import_module(configMod) -- -+ # -+ # add code to load config from nonsystem path -+ # and change to datadir -+ # -+ try: -+ path = os.path.dirname(configMod) -+ fullname = os.path.basename(configMod) -+ sys.path.append(path) -+ config = importlib.import_module(fullname) -+ except: -+ print('Error: loading config') -+ sys.exit(2) -+ try: -+ os.chdir(config.datadir) -+ except: -+ print('Error: datadir not found') -+ sys.exit(3) -+ - if dryrun: - for site in config.sites: - if site['shortname'] == dryrun: Index: trunk/config_template.py =================================================================== --- trunk.orig/config_template.py @@ -56,7 +15,7 @@ Index: trunk/config_template.py # Copyright: (2013-2014) Michael Till Beck # License: GPL-2.0+ -@@ -46,11 +44,11 @@ sender = 'me@mymail.com' +@@ -47,11 +45,11 @@ sender = 'me@mymail.com' smtphost = 'mysmtpprovider.com' useTLS = True smtpport = 587 @@ -113,3 +72,41 @@ Index: trunk/mwcfeedserver.py +except KeyboardInterrupt: + pass +httpd.server_close() +Index: trunk/mwc.py +=================================================================== +--- trunk.orig/mwc.py ++++ trunk/mwc.py +@@ -334,7 +334,7 @@ def pollWebsites(): + + if __name__ == "__main__": + +- configMod = 'config' ++ configMod = '/etc/mwc/mwc-config' + dryrun = None + + try: +@@ -351,7 +351,23 @@ if __name__ == "__main__": + elif opt in ('-d', '--dry-run'): + dryrun = arg + +- config = importlib.import_module(configMod) ++ # ++ # add code to load config from nonsystem path ++ # and change to datadir ++ # ++ try: ++ path = os.path.dirname(configMod) ++ fullname = os.path.basename(configMod) ++ sys.path.append(path) ++ config = importlib.import_module(fullname) ++ except: ++ print('Error: loading config') ++ sys.exit(2) ++ try: ++ os.chdir(config.datadir) ++ except: ++ print('Error: datadir not found') ++ sys.exit(3) + + if dryrun: + for site in config.sites: -- cgit v1.2.3