Esempio n. 1
0
import re
import sys
import os
import xbmc
import xbmcgui
import xbmcaddon
import xbmcplugin
import xbmcvfs
try: 
	import simplejson as json
except ImportError: 
	import json
from metahandler import metahandlers
from donnie.settings import Settings
from donnie.databaseconnector import DataConnector
reg = Settings(['plugin.video.theroyalwe', 'script.module.donnie'])

if reg.getBoolSetting('tv_show_custom_directory'):
	TV_SHOWS_PATH = reg.getSetting('tv_show_directory')
else:
	DATA_PATH = os.path.join(xbmc.translatePath('special://profile/addon_data/plugin.video.theroyalwe'), '')
	TV_SHOWS_PATH = os.path.join(xbmc.translatePath(DATA_PATH + 'tvshows'), '')


def xbmcpath(path,filename):
	path = path.replace('/', os.sep)
     	translatedpath = os.path.join(xbmc.translatePath( path ), ''+filename+'')
     	return translatedpath

def formatStrPath(showname, season, episode):
	strpath = xbmcpath(TV_SHOWS_PATH, showname)
Esempio n. 2
0
from threading import Thread
import shutil
from t0mm0.common.addon import Addon
from threadpool import *
import xbmc
import xbmcaddon
import hashlib
#from proxy import *

ADDON_ID = 'script.module.walter'
SELF = xbmcaddon.Addon(id=ADDON_ID)
ROOT_PATH = SELF.getAddonInfo('path')
sys.path.append( os.path.join( ROOT_PATH, 'lib', 'walter' ) )

from donnie.settings import Settings
reg = Settings(['plugin.video.theroyalwe', 'script.module.walter'])

from databaseconnector import DatabaseClass
from caching import CachingClass

try: 
	import simplejson as json
                                                                                                                                                                                                                                                        
except ImportError: 
	import json  
table = [10,20,30,45,60]
POLLING_DELAY = table[int(reg.getSetting('polling-delay'))]

class StoppableThread(Thread):
    """Thread class with a stop() method. The thread itself has to check
    regularly for the stopped() condition."""