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
Too many changes to show.
To preserve performance only 20 of 1000+ files are displayed.
File moved
.build/Gruntfile.js
deleted
100644 → 0
.build/bower.json
deleted
100644 → 0
.build/package.json
deleted
100644 → 0
Gruntfile.js
0 → 100644
bower.json
0 → 100644
package.json
0 → 100644
{ | ||
"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" | ||
} | ||
} |
#!/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'))] |