mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-07 11:58:01 -05:00
Fix for pyGitHub module not found issue.
Added in bugtracker class
This commit is contained in:
parent
9abe5ea859
commit
4d41d881eb
@ -30,6 +30,8 @@ from threading import Lock
|
|||||||
import sys
|
import sys
|
||||||
import os.path
|
import os.path
|
||||||
sys.path.append(os.path.abspath('../lib'))
|
sys.path.append(os.path.abspath('../lib'))
|
||||||
|
|
||||||
|
from github import Github
|
||||||
from sickbeard import providers, metadata, config, webserveInit
|
from sickbeard import providers, metadata, config, webserveInit
|
||||||
from sickbeard.providers.generic import GenericProvider
|
from sickbeard.providers.generic import GenericProvider
|
||||||
from providers import ezrss, tvtorrents, btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \
|
from providers import ezrss, tvtorrents, btn, newznab, womble, thepiratebay, torrentleech, kat, iptorrents, \
|
||||||
@ -78,6 +80,10 @@ NO_RESIZE = False
|
|||||||
# system events
|
# system events
|
||||||
events = None
|
events = None
|
||||||
|
|
||||||
|
# github
|
||||||
|
gh = None
|
||||||
|
|
||||||
|
# schedualers
|
||||||
dailySearchScheduler = None
|
dailySearchScheduler = None
|
||||||
backlogSearchScheduler = None
|
backlogSearchScheduler = None
|
||||||
showUpdateScheduler = None
|
showUpdateScheduler = None
|
||||||
@ -510,7 +516,7 @@ def initialize(consoleLogging=True):
|
|||||||
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, PROXY_INDEXERS, \
|
USE_FAILED_DOWNLOADS, DELETE_FAILED, ANON_REDIRECT, LOCALHOST_IP, TMDB_API_KEY, DEBUG, PROXY_SETTING, PROXY_INDEXERS, \
|
||||||
AUTOPOSTPROCESSER_FREQUENCY, DEFAULT_AUTOPOSTPROCESSER_FREQUENCY, MIN_AUTOPOSTPROCESSER_FREQUENCY, \
|
AUTOPOSTPROCESSER_FREQUENCY, DEFAULT_AUTOPOSTPROCESSER_FREQUENCY, MIN_AUTOPOSTPROCESSER_FREQUENCY, \
|
||||||
ANIME_DEFAULT, NAMING_ANIME, ANIMESUPPORT, USE_ANIDB, ANIDB_USERNAME, ANIDB_PASSWORD, ANIDB_USE_MYLIST, \
|
ANIME_DEFAULT, NAMING_ANIME, ANIMESUPPORT, USE_ANIDB, ANIDB_USERNAME, ANIDB_PASSWORD, ANIDB_USE_MYLIST, \
|
||||||
ANIME_SPLIT_HOME, SCENE_DEFAULT, PLAY_VIDEOS, BACKLOG_DAYS, GIT_ORG, GIT_REPO
|
ANIME_SPLIT_HOME, SCENE_DEFAULT, PLAY_VIDEOS, BACKLOG_DAYS, GIT_ORG, GIT_REPO, gh
|
||||||
|
|
||||||
if __INITIALIZED__:
|
if __INITIALIZED__:
|
||||||
return False
|
return False
|
||||||
@ -1107,6 +1113,9 @@ def initialize(consoleLogging=True):
|
|||||||
tmp_provider.set_config(cur_metadata_config)
|
tmp_provider.set_config(cur_metadata_config)
|
||||||
metadata_provider_dict[tmp_provider.name] = tmp_provider
|
metadata_provider_dict[tmp_provider.name] = tmp_provider
|
||||||
|
|
||||||
|
# github
|
||||||
|
gh = Github().get_organization(GIT_ORG).get_repo(GIT_REPO)
|
||||||
|
|
||||||
# initialize schedulers
|
# initialize schedulers
|
||||||
# updaters
|
# updaters
|
||||||
update_now = datetime.timedelta(minutes=0)
|
update_now = datetime.timedelta(minutes=0)
|
||||||
|
5
sickbeard/bug_tracker.py
Normal file
5
sickbeard/bug_tracker.py
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
import sickbeard
|
||||||
|
|
||||||
|
class BugTracker:
|
||||||
|
def submit_bug(self, title, error):
|
||||||
|
return sickbeard.gh.create_issue(title, error, labels=[sickbeard.gh().get_label(sickbeard.BRANCH)])
|
@ -28,14 +28,12 @@ import stat
|
|||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
import sickbeard
|
import sickbeard
|
||||||
from github import Github
|
|
||||||
from sickbeard import helpers, notifiers
|
from sickbeard import helpers, notifiers
|
||||||
from sickbeard import ui
|
from sickbeard import ui
|
||||||
from sickbeard import logger
|
from sickbeard import logger
|
||||||
from sickbeard.exceptions import ex
|
from sickbeard.exceptions import ex
|
||||||
from sickbeard import encodingKludge as ek
|
from sickbeard import encodingKludge as ek
|
||||||
|
|
||||||
|
|
||||||
class CheckVersion():
|
class CheckVersion():
|
||||||
"""
|
"""
|
||||||
Version check class meant to run as a thread object with the sr scheduler.
|
Version check class meant to run as a thread object with the sr scheduler.
|
||||||
@ -617,11 +615,9 @@ class SourceUpdateManager(UpdateManager):
|
|||||||
self._num_commits_behind = 0
|
self._num_commits_behind = 0
|
||||||
self._newest_commit_hash = None
|
self._newest_commit_hash = None
|
||||||
|
|
||||||
gh = Github().get_organization(self.github_org).get_repo(self.github_repo)
|
|
||||||
|
|
||||||
# try to get newest commit hash and commits behind directly by comparing branch and current commit
|
# try to get newest commit hash and commits behind directly by comparing branch and current commit
|
||||||
if self._cur_commit_hash:
|
if self._cur_commit_hash:
|
||||||
branch_compared = gh.compare(base=self.branch, head=self._cur_commit_hash)
|
branch_compared = sickbeard.gh.compare(base=self.branch, head=self._cur_commit_hash)
|
||||||
|
|
||||||
if 'base_commit' in branch_compared:
|
if 'base_commit' in branch_compared:
|
||||||
self._newest_commit_hash = branch_compared['base_commit']['sha']
|
self._newest_commit_hash = branch_compared['base_commit']['sha']
|
||||||
@ -632,7 +628,7 @@ class SourceUpdateManager(UpdateManager):
|
|||||||
# fall back and iterate over last 100 (items per page in gh_api) commits
|
# fall back and iterate over last 100 (items per page in gh_api) commits
|
||||||
if not self._newest_commit_hash:
|
if not self._newest_commit_hash:
|
||||||
|
|
||||||
for curCommit in gh.get_commits():
|
for curCommit in sickbeard.gh.get_commits():
|
||||||
if not self._newest_commit_hash:
|
if not self._newest_commit_hash:
|
||||||
self._newest_commit_hash = curCommit['sha']
|
self._newest_commit_hash = curCommit['sha']
|
||||||
if not self._cur_commit_hash:
|
if not self._cur_commit_hash:
|
||||||
@ -764,5 +760,4 @@ class SourceUpdateManager(UpdateManager):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
def list_remote_branches(self):
|
def list_remote_branches(self):
|
||||||
gh = Github().get_organization(self.github_org).get_repo(self.github_repo)
|
return [x.name for x in sickbeard.gh.get_branches() if x]
|
||||||
return [x.name for x in gh.get_branches() if x]
|
|
||||||
|
@ -82,6 +82,7 @@ from lib import adba
|
|||||||
from Cheetah.Template import Template
|
from Cheetah.Template import Template
|
||||||
from tornado.web import RequestHandler, HTTPError, asynchronous
|
from tornado.web import RequestHandler, HTTPError, asynchronous
|
||||||
|
|
||||||
|
from bug_tracker import BugTracker
|
||||||
|
|
||||||
def authenticated(handler_class):
|
def authenticated(handler_class):
|
||||||
def wrap_execute(handler_execute):
|
def wrap_execute(handler_execute):
|
||||||
|
Loading…
Reference in New Issue
Block a user