Commit 64476f7a authored by echel0n's avatar echel0n
Browse files

Merge branch 'release/9.1.40'

parents 92235b02 fea50e21
......@@ -6,7 +6,7 @@ module.exports = function (grunt) {
bower_components: 'bower_components',
//sass: [
// '.sass-cache',
// 'sickrage/core/webserver/gui/default/scss/'
// 'sickrage/core/webserver/static/scss/'
//],
options: {
force: true
......@@ -88,7 +88,7 @@ module.exports = function (grunt) {
googlefonts: {
build: {
options: {
fontPath: 'sickrage/core/webserver/gui/default/fonts/',
fontPath: 'sickrage/core/webserver/static/fonts/',
cssFile: 'dist/css/fonts.css',
httpPath: '../fonts/',
formats: {
......@@ -132,7 +132,7 @@ module.exports = function (grunt) {
flatten: true,
cwd: 'bower_components/bootstrap/fonts/',
src: ['**/*.{eot,svg,ttf,woff,woff2}'],
dest: 'sickrage/core/webserver/gui/default/fonts/'
dest: 'sickrage/core/webserver/static/fonts/'
}]
},
fontawesome: {
......@@ -141,7 +141,7 @@ module.exports = function (grunt) {
flatten: true,
cwd: 'bower_components/components-font-awesome/fonts/',
src: ['**/*.{eot,svg,ttf,woff,woff2}'],
dest: 'sickrage/core/webserver/gui/default/fonts/'
dest: 'sickrage/core/webserver/static/fonts/'
}]
}
},
......@@ -152,7 +152,7 @@ module.exports = function (grunt) {
flatten: true,
cwd: 'bower_components/jquery-ui/themes/',
src: ['**/*.{png,jpg,gif}'],
dest: 'sickrage/core/webserver/gui/default/images/'
dest: 'sickrage/core/webserver/static/images/'
}]
},
tablesorter: {
......@@ -161,7 +161,7 @@ module.exports = function (grunt) {
flatten: true,
cwd: 'bower_components/jquery.tablesorter/dist/css/images/',
src: ['**/*.{png,jpg,gif}'],
dest: 'sickrage/core/webserver/gui/default/images/tablesorter/'
dest: 'sickrage/core/webserver/static/images/tablesorter/'
}]
},
boostrap_formhelpers: {
......@@ -170,14 +170,14 @@ module.exports = function (grunt) {
flatten: true,
cwd: 'bower_components/bootstrap-formhelpers/img/',
src: ['**/*.{png,jpg,gif}'],
dest: 'sickrage/core/webserver/gui/default/images/bootstrap-formhelpers/'
dest: 'sickrage/core/webserver/static/images/bootstrap-formhelpers/'
}]
}
},
sprite: {
icons_sickrage: {
src: 'dist/images/icons/sickrage/*.png',
dest: 'sickrage/core/webserver/gui/default/images/icons-sickrage.png',
dest: 'sickrage/core/webserver/static/images/icons-sickrage.png',
destCss: 'dist/css/icons-sickrage.css',
imgPath: '../images/icons-sickrage.png',
cssTemplate: 'dist/css/icons-sickrage.css.handlebars',
......@@ -187,19 +187,19 @@ module.exports = function (grunt) {
uglify: {
bower: {
files: {
'sickrage/core/webserver/gui/default/js/bower.min.js': ['dist/js/bower.js']
'sickrage/core/webserver/static/js/bower.min.js': ['dist/js/bower.js']
}
},
core: {
files: {
'sickrage/core/webserver/gui/default/js/core.min.js': ['dist/js/core.js']
'sickrage/core/webserver/static/js/core.min.js': ['dist/js/core.js']
}
}
},
sass: {
core: {
files: {
'sickrage/core/webserver/gui/default/scss/core.scss': [
'sickrage/core/webserver/static/scss/core.scss': [
'dist/css/core.css',
'dist/css/fonts.css',
'dist/css/icons-sickrage.css'
......@@ -214,20 +214,20 @@ module.exports = function (grunt) {
},
bower: {
files: {
'sickrage/core/webserver/gui/default/css/bower.min.css': ['dist/css/bower.css']
'sickrage/core/webserver/static/css/bower.min.css': ['dist/css/bower.css']
}
},
core: {
files: {
'sickrage/core/webserver/gui/default/css/core.min.css': [
'sickrage/core/webserver/static/css/core.min.css': [
'dist/css/core.css',
'dist/css/fonts.css',
'dist/css/icons-sickrage.css'
],
'sickrage/core/webserver/gui/default/css/themes/dark.min.css': [
'sickrage/core/webserver/static/css/themes/dark.min.css': [
'dist/css/themes/dark.css'
],
'sickrage/core/webserver/gui/default/css/themes/light.min.css': [
'sickrage/core/webserver/static/css/themes/light.min.css': [
'dist/css/themes/light.css'
]
}
......
# Changelog
- * fc1af8b - 2017-10-17: Release v9.1.39
- * 98a5062 - 2017-10-17: Release v9.1.40
- * 94e71c8 - 2017-10-17: Fixed issue #88 - Show are truncated when show set in different language
- * e6e0237 - 2017-10-17: Added Anizb Newznab provider
- * f45988b - 2017-10-17: Refactored Newznab provider code Refactored locations of static files and mako templates
- * 7aac26b - 2017-10-17: Refactored Newznab provider code Refactored locations of static files and mako templates
- * 6384aab - 2017-10-17: Release v9.1.39
- * f50a313 - 2017-10-17: Fixed issue with gettext underscore being replaced when using underscore as throwaway variable
- * 1da0430 - 2017-10-17: Fixed issue #90 - iptorrents provider needs update
- * 8a3d08a - 2017-10-16: Release v9.1.38
......
......@@ -61,7 +61,7 @@ setup(
]
},
message_extractors={
'sickrage/core/webserver/gui/default': [
'sickrage/core/webserver': [
('**/views/**.mako', 'mako', {'input_encoding': 'utf-8'})
],
'sickrage': [
......
......@@ -192,7 +192,7 @@ class Core(object):
# setup logger settings
self.srLogger.logSize = self.srConfig.LOG_SIZE
self.srLogger.logNr = self.srConfig.LOG_NR
self.srLogger.logFile = self.srConfig.LOG_FILE
self.srLogger.logFile = os.path.join(sickrage.DATA_DIR, 'logs', 'sickrage.log')
self.srLogger.debugLogging = self.srConfig.DEBUG
self.srLogger.consoleLogging = not sickrage.QUITE
......
......@@ -41,7 +41,7 @@ class Media(object):
"""
path = self.get_static_media_path().replace(sickrage.CACHE_DIR, "")
path = path.replace(sickrage.srCore.srConfig.GUI_DIR, "")
path = path.replace(sickrage.srCore.srConfig.GUI_STATIC_DIR, "")
return url_escape(path.replace('\\', '/'), False)
@property
......@@ -79,7 +79,7 @@ class Media(object):
:return: The root folder containing the media
"""
return os.path.join(sickrage.srCore.srConfig.GUI_DIR)
return os.path.join(sickrage.srCore.srConfig.GUI_STATIC_DIR)
def get_show(self):
"""
......
......@@ -70,10 +70,9 @@ class srConfig(object):
self.NAMING_SEP_TYPE = (" - ", " ")
self.NAMING_SEP_TYPE_TEXT = (" - ", "space")
self.LOG_DIR = os.path.abspath(os.path.join(sickrage.DATA_DIR, 'logs'))
self.LOG_FILE = os.path.abspath(os.path.join(self.LOG_DIR, 'sickrage.log'))
self.LOG_SIZE = 1048576
self.LOG_NR = 5
self.VERSION_NOTIFY = True
self.AUTO_UPDATE = True
self.NOTIFY_ON_UPDATE = True
......@@ -381,9 +380,9 @@ class srConfig(object):
self.EMAIL_PASSWORD = None
self.EMAIL_FROM = None
self.EMAIL_LIST = None
self.GUI_NAME = 'default'
self.GUI_DIR = os.path.join(sickrage.PROG_DIR, 'core', 'webserver', 'gui', self.GUI_NAME)
self.GUI_LANG = ""
self.GUI_STATIC_DIR = os.path.join(sickrage.PROG_DIR, 'core', 'webserver', 'static')
self.GUI_VIEWS_DIR = os.path.join(sickrage.PROG_DIR, 'core', 'webserver', 'views')
self.HOME_LAYOUT = None
self.HISTORY_LAYOUT = None
self.HISTORY_LIMIT = 0
......@@ -513,7 +512,6 @@ class srConfig(object):
'GUI': {
'coming_eps_display_paused': False,
'display_show_specials': True,
'gui_name': 'default',
'gui_lang': '',
'history_limit': '100',
'poster_sortdir': 1,
......@@ -1495,7 +1493,6 @@ class srConfig(object):
self.RANDOM_USER_AGENT = self.check_setting_bool('General', 'random_user_agent')
# GUI SETTINGS
self.GUI_NAME = self.check_setting_str('GUI', 'gui_name')
self.GUI_LANG = self.check_setting_str('GUI', 'gui_lang')
self.THEME_NAME = self.check_setting_str('GUI', 'theme_name')
self.FANART_BACKGROUND = self.check_setting_bool('GUI', 'fanart_background')
......@@ -1966,7 +1963,6 @@ class srConfig(object):
'random_user_agent': int(self.RANDOM_USER_AGENT),
},
'GUI': {
'gui_name': self.GUI_NAME,
'gui_lang': self.GUI_LANG,
'theme_name': self.THEME_NAME,
'home_layout': self.HOME_LAYOUT,
......@@ -2445,9 +2441,8 @@ class ConfigMigrator(srConfig):
self.CONFIG_OBJ['General']['encryption_version'] = 2
return self.CONFIG_OBJ
# Migration v9: Rename gui template name from slick to default
# Migration v9: Dummy migration to sync backup number with config version number
def _migrate_v9(self):
self.CONFIG_OBJ['GUI']['gui_name'] = 'default'
return self.CONFIG_OBJ
# Migration v10: Metadata upgrade to add enabled attribute
......
......@@ -20,6 +20,7 @@ from __future__ import unicode_literals
import logging
import os
import pkgutil
import re
from logging import FileHandler, CRITICAL, DEBUG, ERROR, INFO, WARNING
from logging.handlers import RotatingFileHandler
......@@ -63,15 +64,15 @@ class srLogger(logging.getLoggerClass()):
}
# list of allowed loggers
self.allowedLoggers = ['sickrage',
'tornado.general',
'tornado.application',
'apscheduler.jobstores',
'apscheduler.scheduler']
self.loggers = {'sickrage': self,
'tornado.general': logging.getLogger('tornado.general'),
'tornado.application': logging.getLogger('tornado.application'),
'apscheduler.jobstores': logging.getLogger('apscheduler.jobstores'),
'apscheduler.scheduler': logging.getLogger('apscheduler.scheduler')}
# set custom level for database logging
logging.addLevelName(self.logLevels['DB'], 'DB')
logging.getLogger("sickrage").setLevel(self.logLevels['DB'])
self.setLevel(self.logLevels['DB'])
# start logger
self.start()
......@@ -119,7 +120,7 @@ class srLogger(logging.getLoggerClass()):
self.addHandler(rfh_errors)
def makeRecord(self, name, level, fn, lno, msg, args, exc_info, func=None, extra=None):
if (False, True)[name in self.allowedLoggers]:
if (False, True)[name in self.loggers]:
record = super(srLogger, self).makeRecord(name, level, fn, lno, msg, args, exc_info, func, extra)
try:
......@@ -144,12 +145,32 @@ class srLogger(logging.getLoggerClass()):
def set_level(self):
self.debugLogging = sickrage.srCore.srConfig.DEBUG
level = DEBUG if self.debugLogging else INFO
for name in self.allowedLoggers:
logger = logging.getLogger(name)
for __, logger in self.loggers.items():
logger.setLevel(level)
for handler in logger.handlers:
handler.setLevel(level)
def list_modules(self, package):
"""Return all sub-modules for the specified package.
:param package:
:type package: module
:return:
:rtype: list of str
"""
return [modname for importer, modname, ispkg in pkgutil.walk_packages(
path=package.__path__, prefix=package.__name__ + '.', onerror=lambda x: None)]
def get_loggers(self, package):
"""Return all loggers for package and sub-packages.
:param package:
:type package: module
:return:
:rtype: list of logging.Logger
"""
return [logging.getLogger(modname) for modname in self.list_modules(package)]
def log(self, level, msg, *args, **kwargs):
super(srLogger, self).log(level, msg, *args, **kwargs)
......
......@@ -230,8 +230,8 @@ class UpdateManager(object):
sickrage.srCore.srLogger.debug("Not using: " + cur_git)
# Still haven't found a working git
error_message = _('Unable to find your git executable - Shutdown SiCKRAGE and EITHER set git_path in your '
'config.ini OR delete your .git folder and run from source to enable updates.')
error_message = _('Unable to find your git executable - Set your git path from Settings->General->Advanced OR '
'delete your .git folder and run from source to enable updates.')
sickrage.srCore.NEWEST_VERSION_STRING = error_message
......@@ -277,7 +277,7 @@ class UpdateManager(object):
sickrage.srCore.srLogger.debug("Not using: " + cur_pip)
# Still haven't found a working git
error_message = _('Unable to find your pip executable - Shutdown SiCKRAGE and set pip_path in your config.ini')
error_message = _('Unable to find your pip executable - Set your pip path from Settings->General->Advanced')
sickrage.srCore.NEWEST_VERSION_STRING = error_message
return None
......@@ -399,13 +399,6 @@ class GitUpdateManager(UpdateManager):
def get_newest_version(self):
return self._check_for_new_version() or self.version
@staticmethod
def _git_error():
error_message = _('Unable to find your git executable - Shutdown SiCKRAGE and EITHER set git_path in your '
'config.ini OR delete your .git folder and run from source to enable updates. ')
sickrage.srCore.NEWEST_VERSION_STRING = error_message
def _find_installed_version(self):
"""
Attempts to find the currently installed version of SiCKRAGE.
......@@ -700,11 +693,6 @@ class PipUpdateManager(UpdateManager):
def get_newest_version(self):
return self._check_for_new_version() or self.version
@staticmethod
def _pip_error():
error_message = _('Unable to find your pip executable - Shutdown SiCKRAGE and set pip_path in your config.ini.')
sickrage.srCore.NEWEST_VERSION_STRING = error_message
def _find_installed_version(self):
out, __, exit_status = self._pip_cmd(self._pip_path, 'show sickrage')
if exit_status == 0:
......
......@@ -128,27 +128,27 @@ class srWebServer(threading.Thread):
# favicon
(r'%s/(favicon\.ico)' % sickrage.srCore.srConfig.WEB_ROOT, StaticFileHandler,
{"path": os.path.join(sickrage.srCore.srConfig.GUI_DIR, 'images/ico/favicon.ico')}),
{"path": os.path.join(sickrage.srCore.srConfig.GUI_STATIC_DIR, 'images/ico/favicon.ico')}),
# images
(r'%s/images/(.*)' % sickrage.srCore.srConfig.WEB_ROOT, StaticImageHandler,
{"path": os.path.join(sickrage.srCore.srConfig.GUI_DIR, 'images')}),
{"path": os.path.join(sickrage.srCore.srConfig.GUI_STATIC_DIR, 'images')}),
# css
(r'%s/css/(.*)' % sickrage.srCore.srConfig.WEB_ROOT, StaticFileHandler,
{"path": os.path.join(sickrage.srCore.srConfig.GUI_DIR, 'css')}),
{"path": os.path.join(sickrage.srCore.srConfig.GUI_STATIC_DIR, 'css')}),
# scss
(r'%s/scss/(.*)' % sickrage.srCore.srConfig.WEB_ROOT, StaticFileHandler,
{"path": os.path.join(sickrage.srCore.srConfig.GUI_DIR, 'scss')}),
{"path": os.path.join(sickrage.srCore.srConfig.GUI_STATIC_DIR, 'scss')}),
# fonts
(r'%s/fonts/(.*)' % sickrage.srCore.srConfig.WEB_ROOT, StaticFileHandler,
{"path": os.path.join(sickrage.srCore.srConfig.GUI_DIR, 'fonts')}),
{"path": os.path.join(sickrage.srCore.srConfig.GUI_STATIC_DIR, 'fonts')}),
# javascript
(r'%s/js/(.*)' % sickrage.srCore.srConfig.WEB_ROOT, StaticFileHandler,
{"path": os.path.join(sickrage.srCore.srConfig.GUI_DIR, 'js')}),
{"path": os.path.join(sickrage.srCore.srConfig.GUI_STATIC_DIR, 'js')}),
# videos
(r'%s/videos/(.*)' % sickrage.srCore.srConfig.WEB_ROOT, StaticFileHandler,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment