コード例 #1
0
ファイル: __init__.py プロジェクト: Twoure/WebTools.bundle
def Start():
    global SECRETKEY

    if DEBUGMODE:
        print("********  Started %s on %s at %s **********" %
              (NAME + ' V' + VERSION, Platform.OS,
               time.strftime("%Y-%m-%d %H:%M")))
    Log.Debug(
        "*******  Started %s on %s at %s ***********" %
        (NAME + ' V' + VERSION, Platform.OS, time.strftime("%Y-%m-%d %H:%M")))
    Log.Debug('Locale is: ' + str(locale.getdefaultlocale()))
    # TODO: Nasty workaround for issue 189
    if (Platform.OS == 'Windows'
            and locale.getpreferredencoding() == 'cp1251'):
        sys.setdefaultencoding("cp1251")
        Log.Debug("Default set to cp1251")
    HTTP.CacheTime = 0
    DirectoryObject.thumb = R(ICON)
    ObjectContainer.title1 = NAME + ' V' + VERSION
    Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
    ObjectContainer.view_group = 'List'
    makeSettings()

    # Get the secret key used to access the PMS framework ********** FUTURE USE ***************
    SECRETKEY = genSecretKeyAsStr()
    startWeb(SECRETKEY)
コード例 #2
0
ファイル: __init__.py プロジェクト: dagalufh/WebTools.bundle
def Start():
    global SECRETKEY
    runningLocale = locale.getdefaultlocale()
    if DEBUGMODE:
        try:
            print("********  Started %s on %s at %s with locale set to %s **********" %
                  (NAME + ' V' + VERSION, Platform.OS, time.strftime("%Y-%m-%d %H:%M"), runningLocale))
        except:
            pass
    Log.Debug("*******  Started %s on %s at %s with locale set to %s ***********" %
              (NAME + ' V' + VERSION, Platform.OS, time.strftime("%Y-%m-%d %H:%M"), runningLocale))
    # Do Upgrade stuff if needed
    upgradeCleanup()
    # TODO: Nasty workaround for issue 189
    if (Platform.OS == 'Windows' and locale.getpreferredencoding() == 'cp1251'):
        sys.setdefaultencoding("cp1251")
        Log.Debug("Default set to cp1251")
    HTTP.CacheTime = 0
    DirectoryObject.thumb = R(ICON)
    ObjectContainer.title1 = NAME + ' V' + VERSION
    Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
    ObjectContainer.view_group = 'List'
    # Get the secret key used to access the PMS framework ********** FUTURE USE ***************
    SECRETKEY = genSecretKeyAsStr()
    startWeb(SECRETKEY)
コード例 #3
0
def Start():
    global SECRETKEY
    global VERSION
    global DEBUGMODE
    # Switch to debug mode if needed
    debugFile = Core.storage.join_path(Core.app_support_path,
                                       Core.config.bundles_dir_name,
                                       NAME + '.bundle', 'debug')
    DEBUGMODE = os.path.isfile(debugFile)
    if DEBUGMODE:
        VERSION = VERSION + ' ****** WARNING Debug mode on *********'
        print("********  Started %s on %s  **********" %
              (NAME + ' V' + VERSION, Platform.OS))
    Log.Debug("*******  Started %s on %s  ***********" %
              (NAME + ' V' + VERSION, Platform.OS))
    HTTP.CacheTime = 0
    DirectoryObject.thumb = R(ICON)
    ObjectContainer.title1 = NAME + ' V' + VERSION
    Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
    ObjectContainer.view_group = 'List'
    makeSettings()

    # Get the secret key used to access the PMS framework ********** FUTURE USE ***************
    SECRETKEY = genSecretKeyAsStr()
    startWeb(SECRETKEY, VERSION, DEBUGMODE)
コード例 #4
0
def Start():
    '''
    This is the startup call of the plugin
    '''
    # Set Plugin UI to the language the user wants
    # Note that title of prefs dialog is controlled by PMS :(
    Locale.DefaultLocale = UILANGUAGE

    global SECRETKEY
    runningLocale = locale.getdefaultlocale()
    strLog = ''.join((
        '"*******  Started %s' % (NAME + ' V' + VERSION),
        ' on %s' % Platform.OS,
        ' at %s' % time.strftime("%Y-%m-%d %H:%M"),
        ' with locale set to %s' % str(runningLocale),
        ' and file system encoding is %s' % str(sys.getfilesystemencoding()),
        ' **********'
    ))
    logDirInfo()
    if DEBUGMODE:
        try:
            print strLog
        except:
            pass
    Log.Debug(strLog)
    # Do Upgrade stuff if needed
    upgradeCleanup()
    # TODO: Nasty workaround for Python not picking up file system encodings
    if (
        (
            Platform.OS == 'Windows') and (
                locale.getpreferredencoding() == 'cp1251')):
        reload(sys)
        sys.setdefaultencoding("cp1251")
        Log.Debug("Default set to cp1251")
    if locale.getpreferredencoding() is None:
        Log.Info('No default filesystem encoding detected')
        reload(sys)
        sys.setdefaultencoding('utf-8')
        Log.Info('Setting default to utf-8')

    HTTP.CacheTime = 0
    DirectoryObject.thumb = R(ICON)
    ObjectContainer.title1 = NAME + ' V' + VERSION
    Plugin.AddViewGroup(
        'List',
        viewMode='List',
        mediaType='items')
    ObjectContainer.view_group = 'List'
    # Get the secret key used to access the
    # PMS framework ********** FUTURE USE ***************
    SECRETKEY = genSecretKeyAsStr()
    startWeb(SECRETKEY)
コード例 #5
0
ファイル: __init__.py プロジェクト: fuzeman/WebTools.bundle
def Start():
	global SECRETKEY
	PLUGIN_VERSION = VERSION	
	print("********  Started %s on %s  **********" %(NAME  + ' V' + PLUGIN_VERSION, Platform.OS))
	Log.Debug("*******  Started %s on %s  ***********" %(NAME + ' V' + PLUGIN_VERSION, Platform.OS))
	HTTP.CacheTime = 0
	DirectoryObject.thumb = R(ICON)
	ObjectContainer.title1 = NAME + ' V' + PLUGIN_VERSION 
	Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
	ObjectContainer.view_group = 'List'
	makeSettings()

	# Get the secret key used to access the PMS framework ********** FUTURE USE ***************
	SECRETKEY = genSecretKeyAsStr()
	startWeb(SECRETKEY)
コード例 #6
0
def Start():
    global SECRETKEY
    PLUGIN_VERSION = VERSION
    print("********  Started %s on %s  **********" %
          (NAME + ' V' + PLUGIN_VERSION, Platform.OS))
    Log.Debug("*******  Started %s on %s  ***********" %
              (NAME + ' V' + PLUGIN_VERSION, Platform.OS))
    HTTP.CacheTime = 0
    DirectoryObject.thumb = R(ICON)
    ObjectContainer.title1 = NAME + ' V' + PLUGIN_VERSION
    Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
    ObjectContainer.view_group = 'List'
    makeSettings()

    # Get the secret key used to access the PMS framework ********** FUTURE USE ***************
    SECRETKEY = genSecretKeyAsStr()
    startWeb(SECRETKEY)
コード例 #7
0
ファイル: __init__.py プロジェクト: FSA1/WebTools.bundle
def Start():
	global SECRETKEY
	global VERSION
	global DEBUGMODE
	# Switch to debug mode if needed
	debugFile = Core.storage.join_path(Core.app_support_path, Core.config.bundles_dir_name, NAME + '.bundle', 'debug')
	DEBUGMODE = os.path.isfile(debugFile)
	if DEBUGMODE:
		VERSION = VERSION + ' ****** WARNING Debug mode on *********'
		print("********  Started %s on %s  **********" %(NAME  + ' V' + VERSION, Platform.OS))
	Log.Debug("*******  Started %s on %s  ***********" %(NAME + ' V' + VERSION, Platform.OS))
	HTTP.CacheTime = 0
	DirectoryObject.thumb = R(ICON)
	ObjectContainer.title1 = NAME + ' V' + VERSION 
	Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
	ObjectContainer.view_group = 'List'
	makeSettings()

	# Get the secret key used to access the PMS framework ********** FUTURE USE ***************
	SECRETKEY = genSecretKeyAsStr()
	startWeb(SECRETKEY, VERSION, DEBUGMODE)
コード例 #8
0
ファイル: __init__.py プロジェクト: Twoure/WebTools.bundle
def Restart():
    time.sleep(3)
    startWeb(SECRETKEY)
    return
コード例 #9
0
ファイル: __init__.py プロジェクト: fuzeman/WebTools.bundle
def Restart():
	time.sleep(3)
	startWeb(SECRETKEY)
	return
コード例 #10
0
def Restart():
    ''' Restart WebTools'''
    time.sleep(3)
    startWeb(SECRETKEY)
    return