From 81de9529c32bf77d397ec1a11b5360a85c8490eb Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 3 Jun 2014 16:52:44 +0200 Subject: [PATCH 1/3] Force folder creation on startup --- couchpotato/runner.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/couchpotato/runner.py b/couchpotato/runner.py index 3cdd8648..060b7ad3 100644 --- a/couchpotato/runner.py +++ b/couchpotato/runner.py @@ -126,13 +126,23 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En else: db.create() + # Force creation of cachedir + log_dir = sp(log_dir) + cache_dir = sp(os.path.join(data_dir, 'cache')) + python_cache = sp(os.path.join(cache_dir, 'python')) + + if not os.path.exists(cache_dir): + os.mkdir(cache_dir) + if not os.path.exists(python_cache): + os.mkdir(python_cache) + # Register environment settings Env.set('app_dir', sp(base_path)) Env.set('data_dir', sp(data_dir)) Env.set('log_path', sp(os.path.join(log_dir, 'CouchPotato.log'))) Env.set('db', db) - Env.set('cache_dir', sp(os.path.join(data_dir, 'cache'))) - Env.set('cache', FileSystemCache(sp(os.path.join(Env.get('cache_dir'), 'python')))) + Env.set('cache_dir', cache_dir) + Env.set('cache', FileSystemCache(python_cache)) Env.set('console_log', options.console_log) Env.set('quiet', options.quiet) Env.set('desktop', desktop) From daa06628694df7f4d28d84fa0a8515e8dd8ed12a Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 3 Jun 2014 16:54:08 +0200 Subject: [PATCH 2/3] XMPP was importing itself --- couchpotato/core/notifications/{xmpp.py => xmpp_.py} | 2 ++ 1 file changed, 2 insertions(+) rename couchpotato/core/notifications/{xmpp.py => xmpp_.py} (99%) diff --git a/couchpotato/core/notifications/xmpp.py b/couchpotato/core/notifications/xmpp_.py similarity index 99% rename from couchpotato/core/notifications/xmpp.py rename to couchpotato/core/notifications/xmpp_.py index f9916cd0..9cee8c5a 100644 --- a/couchpotato/core/notifications/xmpp.py +++ b/couchpotato/core/notifications/xmpp_.py @@ -5,6 +5,8 @@ from couchpotato.core.logger import CPLog from couchpotato.core.notifications.base import Notification import xmpp +print xmpp + log = CPLog(__name__) From b894139ca10fda63272294ffa408372f7cf3f221 Mon Sep 17 00:00:00 2001 From: Ruud Date: Tue, 3 Jun 2014 16:54:21 +0200 Subject: [PATCH 3/3] Make full path for logs --- CouchPotato.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CouchPotato.py b/CouchPotato.py index 364d77a4..f21b9393 100755 --- a/CouchPotato.py +++ b/CouchPotato.py @@ -50,7 +50,7 @@ class Loader(object): # Create logging dir self.log_dir = os.path.join(self.data_dir, 'logs'); if not os.path.isdir(self.log_dir): - os.mkdir(self.log_dir) + os.makedirs(self.log_dir) # Logging from couchpotato.core.logger import CPLog