Example #1
0
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)
Example #2
0
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)
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)
Example #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)
Example #5
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)
Example #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)
Example #7
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)
Example #8
0
def Restart():
    time.sleep(3)
    startWeb(SECRETKEY)
    return
Example #9
0
def Restart():
	time.sleep(3)
	startWeb(SECRETKEY)
	return
Example #10
0
def Restart():
    ''' Restart WebTools'''
    time.sleep(3)
    startWeb(SECRETKEY)
    return