Commit 7aac26b4 authored by echel0n's avatar echel0n
Browse files

Refactored Newznab provider code

Refactored locations of static files and mako templates
parent 871fdb71
......@@ -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
- * 71d4cf6 - 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
......
......@@ -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:
......
This source diff could not be displayed because it is too large. You can view the blob instead.
.progress-100,.progress-80{-moz-border-radius:3px;-webkit-border-radius:3px}.navbar-default,.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#3e3f3a}.progress-100{background-image:-moz-linear-gradient(#a6cf41,#5b990d)!important;background-image:linear-gradient(#a6cf41,#5b990d)!important;background-image:-webkit-linear-gradient(#a6cf41,#5b990d)!important;background-image:-o-linear-gradient(#a6cf41,#5b990d)!important;border-radius:3px}.progress-80{background-image:-moz-linear-gradient(#e1ff97,#9db269)!important;background-image:linear-gradient(#e1ff97,#9db269)!important;background-image:-webkit-linear-gradient(#e1ff97,#9db269)!important;background-image:-o-linear-gradient(#e1ff97,#9db269)!important;border-radius:3px}.progress-40,.progress-60{-moz-border-radius:3px;-webkit-border-radius:3px}.progress-60{background-image:-moz-linear-gradient(#fad440,#f2a70d)!important;background-image:linear-gradient(#fad440,#f2a70d)!important;background-image:-webkit-linear-gradient(#fad440,#f2a70d)!important;background-image:-o-linear-gradient(#fad440,#f2a70d)!important;border-radius:3px}.progress-40{background-image:-moz-linear-gradient(#fab543,#f2700d)!important;background-image:linear-gradient(#fab543,#f2700d)!important;background-image:-webkit-linear-gradient(#fab543,#f2700d)!important;background-image:-o-linear-gradient(#fab543,#f2700d)!important;border-radius:3px}.progress-20{background-image:-moz-linear-gradient(#da5945,#b11a10)!important;background-image:linear-gradient(#da5945,#b11a10)!important;background-image:-webkit-linear-gradient(#da5945,#b11a10)!important;background-image:-o-linear-gradient(#da5945,#b11a10)!important;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px}.displayShowTable th.row-seasonheader{background-color:#fff!important;color:#000!important}tr.seasonheader{color:#000!important}table.cal-odd{background-color:#ddd}table.cal-even{background-color:#d2d2d2}.calendarShow .text .airtime{color:#000}.calendarShow .text .episode-title{color:#888}.navbar-default{background-color:#333;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#333333');background:-webkit-gradient(linear,left top,left bottom,from(#555),to(#333));background:-moz-linear-gradient(top,#555,#333)}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{background-color:#333}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{color:#fff;text-decoration:none;background-color:#333}pre{color:#000;background-color:#F5F5F5;border-color:#ccc}.tablesorter{width:100%;margin-right:auto;margin-left:auto;color:#000;text-align:left;background-color:#ddd;border-spacing:0}.tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}div.token-input-dropdown{background-color:#fff;color:#000;border-left-color:#ccc;border-right-color:#ccc;border-bottom-color:#ccc}.modal-header{padding:9px 15px;border-bottom:1px solid #eee;background-color:#F5F1E4;-webkit-border-top-left-radius:5px;-webkit-border-top-right-radius:5px;-moz-border-radius-topleft:5px;-moz-border-radius-topright:5px;border-top-left-radius:5px;border-top-right-radius:5px}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
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