Commit cb6ecf1c authored by echel0n's avatar echel0n
Browse files

Restruct of javascript routines and imports.

Added in javascript router to handler controller actions and proper routing of them.
Version bump to 8.0.0
parent a58ca539
module.exports = function(grunt) {
grunt.initConfig({
bower_concat: {
all: {
dest: '../gui/slick/js/_bower.js',
// cssDest: 'gui/slick/css/_bower.css',
exclude: [
// 'jquery',
// 'modernizr'
],
dependencies: {
// 'underscore': 'jquery',
// 'backbone': 'underscore',
// 'jquery-mousewheel': 'jquery'
},
bowerOptions: {
relative: false
},
}
},
uglify: {
my_target: {
files: {
'../gui/slick/js/_bower.min.js': ['../gui/slick/js/_bower.js']
}
}
}
});
grunt.loadNpmTasks('grunt-bower-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['bower_concat', 'uglify']);
};
{
"name": "SiCKRAGE",
"version": "4.0.72",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "~2.1.4",
"bootstrap": "~3.3.5",
"bootstrap-hover-dropdown": "~2.1.3",
"jquery-ui": "~1.11.4",
"tablesorter": "jquery.tablesorter#~2.23.5",
"jquery-form": "~3.46.0",
"jquery-timeago": "~1.4.3",
"jquery-tokeninput": "~1.7.0",
"bootstrap3-typeahead": "~3.1.1",
"underscore": "~1.8.3"
}
}
{
"name": "sickrage",
"version": "4.0.72",
"private": true,
"dependencies": {
"grunt": "^0.4.5",
"grunt-bower-concat": "^0.5.0",
"grunt-contrib-uglify": "^0.9.2"
},
"repository": {
"type": "git",
"url": "git+https://github.com/SiCKRAGETV/SiCKRAGE.git"
},
"bugs": {
"url": "https://www.sickrage.tv/forums/"
},
"homepage": "https://github.com/SiCKRAGETV/SiCKRAGE#readme"
}
......@@ -59,11 +59,20 @@ desktop.ini
ehthumbs.db
Thumbs.db
.directory
*~
*.torrent
*~
# GruntJS Files #
######################
Gruntfile.js
# NodeJS Files #
######################
package.json
node_modules
# Bower #
######################
bower_components
node_modules
bower.json
_bower.js
{
"bitwise": true,
"browser": true,
"camelcase": true,
"curly": true,
"devel": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"indent": 4,
"jquery": true,
"latedef": true,
"maxerr": 2,
"noarg": true,
"noempty": true,
"nonbsp": true,
"undef": true,
"unused": true,
"node": true,
"globals": {
"srRoot": true,
"themeSpinner": true,
"metaToBool": true,
"getMeta": true,
"isMeta": true,
"generate_bwlist": true,
"_": true,
"bootbox": true,
"PNotify": true,
"anonURL": true
}
}
"bitwise": false,
"browser": true,
"camelcase": false,
"curly": true,
"devel": true,
"expr": true,
"eqeqeq": true,
"forin": true,
"freeze": true,
"indent": 4,
"latedef": true,
"maxerr": 100,
"maxlen": 1000,
"mocha": true,
"noarg": true,
"noempty": true,
"nonbsp": true,
"undef": true,
"unused": true,
"node": true,
"jquery": true,
"globals": {
"jQuery": true,
"PNotify": true,
"chai": true,
"mocha": true,
"_": true,
"window": true
}
}
\ No newline at end of file
module.exports = function (grunt) {
require('load-grunt-tasks')(grunt);
grunt.initConfig({
clean: {
dist: 'dist',
bower_components: 'bower_components',
fonts: 'sickrage/core/webserver/gui/default/fonts/',
images: [
'sickrage/core/webserver/gui/default/images/ui/',
'sickrage/core/webserver/gui/default/images/tablesorter/'
],
sass: [
'.sass-cache',
'sickrage/core/webserver/gui/default/scss/'
],
options: {
force: true
}
},
bower: {
install: {
options: {
copy: false
}
}
},
bower_concat: {
all: {
dest: 'dist/bower.js',
cssDest: 'dist/bower.css',
callback: function (mainFiles) {
return mainFiles.map(function (filepath) {
var min = filepath.replace(/\.js$/, '.min.js');
return grunt.file.exists(min) ? min : filepath;
});
},
mainFiles: {
'bootstrap': [
'dist/css/bootstrap.min.css',
'dist/js/bootstrap.min.js'
],
'jquery-ui': [
'jquery-ui.min.js',
'themes/base/jquery-ui.min.css'
],
'bootstrap-formhelpers': [
'dist/js/bootstrap-formhelpers.min.js'
],
'jquery.tablesorter': [
'dist/js/jquery.tablesorter.combined.min.js',
'dist/js/widgets/widget-columnSelector.min.js',
'dist/css/theme.blue.min.css'
],
'isotope': [
"dist/isotope.pkgd.min.js"
],
'jquery-json': [
'dist/jquery.json.min.js'
],
'pnotify': [
'dist/pnotify.js',
'dist/pnotify.desktop.js',
'dist/pnotify.nonblock.js',
'dist/pnotify.css'
],
"outlayer": [
"item.js",
"outlayer.js"
],
"qtip2": [
"jquery.qtip.min.js",
"jquery.qtip.min.css"
]
},
bowerOptions: {
relative: false
},
dependencies: {
'formwizard': 'jquery',
'selectboxes': 'jquery',
'bookmarkscroll': 'jquery'
}
}
},
googlefonts: {
build: {
options: {
fontPath: 'sickrage/core/webserver/gui/default/fonts/',
cssFile: 'dist/fonts.css',
formats: {
eot: true,
ttf: true,
woff: true,
woff2: true,
svg: true
},
fonts: [
{
family: 'Open Sans',
styles: [
300, '300italic',
400, '400italic',
600, '600italic',
700, '700italic',
800, '800italic'
]
},
{
family: 'Droid Sans',
styles: [
400, 700
]
}
]
}
}
},
copy: {
glyphicon: {
files: [{
expand: true,
flatten: true,
cwd: 'bower_components/bootstrap/fonts/',
src: ['**/*.{eot,svg,ttf,woff,woff2}'],
dest: 'sickrage/core/webserver/gui/default/fonts/'
}]
}
},
imagemin: {
options: {
optimizationLevel: 3
},
jqueryui: {
files: [{
expand: true,
flatten: true,
cwd: 'bower_components/jquery-ui/themes/',
src: ['**/*.{png,jpg,gif}'],
dest: 'sickrage/core/webserver/gui/default/images/ui/'
}]
},
tablesorter: {
files: [{
expand: true,
flatten: true,
cwd: 'bower_components/jquery.tablesorter/dist/css/images/',
src: ['**/*.{png,jpg,gif}'],
dest: 'sickrage/core/webserver/gui/default/images/tablesorter/'
}]
}
},
uglify: {
options: {
mangle: false
},
bower: {
files: {
'sickrage/core/webserver/gui/default/js/bower.min.js': ['dist/bower.js']
}
},
core: {
files: {
'sickrage/core/webserver/gui/default/js/core.min.js': [
'sickrage/core/webserver/gui/default/js/core.js'
]
}
}
},
sass: {
core: {
files: {
'sickrage/core/webserver/gui/default/scss/core.scss': 'sickrage/core/webserver/gui/default/css/core.css'
}
}
},
cssmin: {
options: {
shorthandCompacting: false,
roundingPrecision: -1
},
bower: {
files: {
'sickrage/core/webserver/gui/default/css/bower.min.css': ['dist/bower.css']
}
},
core: {
files: {
'sickrage/core/webserver/gui/default/css/core.min.css': [
'sickrage/core/webserver/gui/default/css/core.css',
'dist/fonts.css'
]
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [
'sickrage/core/webserver/gui/default/js/**/*.js',
'!sickrage/core/webserver/gui/default/js/**/*.min.js'
]
}
});
grunt.registerTask('default', [
'clean',
'bower',
'bower_concat',
'googlefonts',
'copy',
'imagemin',
'uglify',
'sass',
'cssmin',
'jshint'
]
);
};
\ No newline at end of file
......@@ -18,8 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function, unicode_literals
from __future__ import unicode_literals
if __name__ == '__main__':
import sickrage
sickrage.main()
from sickrage import main
main()
......@@ -18,8 +18,8 @@
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
from __future__ import print_function, unicode_literals
from __future__ import unicode_literals
if __name__ == '__main__':
import sickrage
sickrage.main()
from sickrage import main
main()
{
"name": "SiCKRAGE",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"jquery": "^2.1.4",
"bootstrap": "^3.0.0",
"bootstrap-hover-dropdown": "^2.1.3",
"bootstrap3-typeahead": "^3.1.1",
"bootstrap-formhelpers": "^2.3.0",
"jquery-ui": "^1.11.4",
"jquery-form": "^3.46.0",
"jquery-timeago": "^1.4.3",
"jquery-tokeninput": "^1.7.0",
"bootbox.js": "^4.4.0",
"underscore": "^1.8.3",
"pnotify": "^3.0.0",
"jquery.cookie": "^1.4.1",
"cookiejar": "*",
"jquery-json": "^2.5.1",
"jqueryui-touch-punch": "*",
"jquery-confirm": "^2.5.2",
"isotope": "^2.2.2",
"formwizard": "http://www.dynamicdrive.com/dynamicindex16/formwizard.js",
"selectboxes": "https://raw.githubusercontent.com/SamWM/jQuery-Plugins/master/selectboxes/jquery.selectboxes.js",
"bookmarkscroll": "http://dynamicdrive.com/dynamicindex5/bookmarkscroll.js",
"jquery.tablesorter": "^2.25.4",
"scrollup": "^2.4.1",
"qtip2": "^2.2.1"
},
"resolutions": {
"bootstrap": "^3.0.0"
}
}
{
"name": "SiCKRAGE",
"version": "7.0.24",
"private": true,
"repository": {
"type": "git",
"url": "git+https://github.com/SiCKRAGETV/SiCKRAGE.git"
},
"bugs": {
"url": "https://www.sickrage.tv"
},
"homepage": "https://www.sickrage.tv",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-bower-concat": "^0.5.0",
"grunt-bower-task": "^0.4.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-copy": "^0.8.2",
"grunt-contrib-cssmin": "^0.14.0",
"grunt-contrib-imagemin": "^1.0.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-sass": "^0.9.2",
"grunt-contrib-uglify": "^0.9.2",
"grunt-google-fonts": "^0.3.0",
"load-grunt-tasks": "^3.4.0"
}
}
......@@ -60,7 +60,7 @@ A full list can be found here: [Link](https://github.com/SiCKRAGETV/sickrage-iss
![image](http://kat.cr/favicon.ico)[KickAssTorrents](https://kat.cr)
![image](https://nzb.cat/favicon.ico)[NZB.cat](https://nzb.cat/)
![image](https://nzbgeek.info/favicon.ico)[NZBGeek](https://nzbgeek.info)
![image](https://raw.githubusercontent.com/SiCKRAGETV/SickRage/master/gui/slick/images/providers/dognzb.png)[DOGnzb](dognzb.cr)
![image](https://raw.githubusercontent.com/SiCKRAGETV/SickRage/master/gui/default/images/providers/dognzb.png)[DOGnzb](dognzb.cr)
#### News and Changelog
[news.md and CHANGES.md have moved to a separate repo, click here](http://github.com/SiCKRAGETV/sickrage-news)
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
# Author: echel0n <[email protected]>
# URL: http://www.github.com/sickragetv/sickrage/
#
......@@ -18,39 +18,91 @@
# You should have received a copy of the GNU General Public License
# along with SickRage. If not, see <http://www.gnu.org/licenses/>.
from __future__ import unicode_literals
from __future__ import unicode_literals, with_statement
import atexit
import ctypes
import codecs
import getopt
import io
import locale
import os
import sys
import threading
import time
import traceback
# set thread name
threading.currentThread().setName('MAIN')
__all__ = [
'srCore',
'srLogger',
'srConfig',
'srScheduler',
'srWebServer',
'PROG_DIR',
'DATA_DIR',
'DEVELOPER',
'SYS_ENCODING'
]
time.strptime("2012", "%Y")
SYS_ENCODING = "UTF-8"
DEVELOPER = False
PROG_DIR = os.path.abspath(os.path.dirname(__file__))
DATA_DIR = os.path.abspath(os.path.join(os.path.expanduser("~"), '.sickrage'))
srCore = None
srLogger = None
srConfig = None
srScheduler = None
srWebServer = None
PROG_DIR = os.path.abspath(os.path.dirname(__file__))
DATA_DIR = os.path.abspath(os.path.join(os.path.expanduser("~"), '.sickrage'))
# fix threading time bug
time.strptime("2012", "%Y")
# set thread name
threading.currentThread().setName('MAIN')
def print_logo():
from colorama import init
from termcolor import cprint
from pyfiglet import figlet_format
init(strip=not sys.stdout.isatty()) # strip colors if stdout is redirected
cprint(figlet_format('SiCKRAGE', font='doom'))
def encodingInit():
# map the following codecs to utf-8
codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None)
codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp1252' else None)
# get locale encoding
try:
locale.setlocale(locale.LC_ALL, "")
encoding = locale.getpreferredencoding()
except (locale.Error, IOError):
encoding = None
# enforce UTF-8
if not encoding or codecs.lookup(encoding).name == 'ascii':
encoding = 'UTF-8'
# wrap i/o in unicode
sys.stdout = codecs.getwriter(encoding)(sys.stdout)
sys.stdin = codecs.getreader(encoding)(sys.stdin)
return encoding
def root_check():
def isElevatedUser():
try:
return not os.getuid() == 0
return os.getuid() == 0
except AttributeError:
return not ctypes.windll.shell32.IsUserAnAdmin() != 0
import ctypes
return ctypes.windll.shell32.IsUserAnAdmin() != 0
def virtualenv_check():
def isVirtualEnv():
return hasattr(sys, 'real_prefix')
......@@ -62,7 +114,6 @@ def install_pip():
file_name = os.path.abspath(os.path.join(os.path.dirname(__file__), url.split('/')[-1]))
u = urllib2.urlopen(url)
with io.open(file_name, 'wb') as f:
meta = u.info()
block_sz = 8192
while True:
buf = u.read(block_sz)
......@@ -72,19 +123,18 @@ def install_pip():
print("Installing pip ...")
import subprocess
subprocess.call([sys.executable, file_name] + ([], ['--user'])[root_check() and virtualenv_check()])
subprocess.call([sys.executable, file_name] + ([], ['--user'])[all([isElevatedUser(), not isVirtualEnv()])])
print("Cleaning up downloaded pip files")
os.remove(file_name)
def install_requirements():
from pip.commands.install import InstallCommand
from pkg_resources import ContextualVersionConflict
def install_requirements(pkg=None):
from pip.commands.install import InstallCommand, InstallationError
requirements = [os.path.abspath(os.path.join(os.path.dirname(__file__), 'requirements.txt'))]