Commit f45988ba authored by echel0n's avatar echel0n
Browse files

Refactored Newznab provider code

Refactored locations of static files and mako templates
parent 7aac26b4
# Changelog
- * 71d4cf6 - 2017-10-17: Refactored Newznab provider code Refactored locations of static files and mako templates
- * d79c29c - 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
......
......@@ -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
......
......@@ -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,
......
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
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