Merge branch 'refs/heads/develop' into tv

Conflicts:
	couchpotato/core/media/movie/_base/main.py
	couchpotato/core/media/movie/library/movie/main.py
	couchpotato/core/plugins/dashboard/main.py
	couchpotato/core/plugins/profile/main.py
	couchpotato/core/plugins/release/main.py
	couchpotato/core/plugins/suggestion/main.py
This commit is contained in:
Ruud
2013-09-11 23:13:28 +02:00
120 changed files with 4428 additions and 1660 deletions
+16 -6
View File
@@ -1,6 +1,6 @@
from argparse import ArgumentParser
from cache import FileSystemCache
from couchpotato import KeyHandler
from couchpotato import KeyHandler, LoginHandler, LogoutHandler
from couchpotato.api import NonBlockHandler, ApiHandler
from couchpotato.core.event import fireEventAsync, fireEvent
from couchpotato.core.helpers.encoding import toUnicode
@@ -91,7 +91,12 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
src_files = [options.config_file, db_path, db_path + '-shm', db_path + '-wal']
for src_file in src_files:
if os.path.isfile(src_file):
shutil.copy2(src_file, toUnicode(os.path.join(new_backup, os.path.basename(src_file))))
dst_file = toUnicode(os.path.join(new_backup, os.path.basename(src_file)))
shutil.copyfile(src_file, dst_file)
# Try and copy stats seperately
try: shutil.copystat(src_file, dst_file)
except: pass
# Remove older backups, keep backups 3 days or at least 3
backups = []
@@ -109,7 +114,7 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
try:
if os.path.isfile(file_path):
os.remove(file_path)
except Exception, e:
except:
raise
os.rmdir(backup)
@@ -230,10 +235,11 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
log_function = lambda x : None,
debug = config['use_reloader'],
gzip = True,
cookie_secret = api_key,
login_url = '%slogin/' % web_base,
)
Env.set('app', application)
# Request handlers
application.add_handlers(".*$", [
(r'%snonblock/(.*)(/?)' % api_base, NonBlockHandler),
@@ -243,18 +249,22 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
(r'%sgetkey(/?)' % web_base, KeyHandler), # Get API key
(r'%s' % api_base, RedirectHandler, {"url": web_base + 'docs/'}), # API docs
# Login handlers
(r'%slogin(/?)' % web_base, LoginHandler),
(r'%slogout(/?)' % web_base, LogoutHandler),
# Catch all webhandlers
(r'%s(.*)(/?)' % web_base, WebHandler),
(r'(.*)', WebHandler),
])
# Static paths
static_path = '%sstatic/' % api_base
static_path = '%sstatic/' % web_base
for dir_name in ['fonts', 'images', 'scripts', 'style']:
application.add_handlers(".*$", [
('%s%s/(.*)' % (static_path, dir_name), StaticFileHandler, {'path': toUnicode(os.path.join(base_path, 'couchpotato', 'static', dir_name))})
])
Env.set('static_path', static_path);
Env.set('static_path', static_path)
# Load configs & plugins