示例#1
0
def Start():
    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 at %s with locale set to %s **********"
            % (NAME + ' V' + version, Platform.OS,
               time.strftime("%Y-%m-%d %H:%M"), locale.getdefaultlocale()))
    else:
        version = VERSION
    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"),
         locale.getdefaultlocale()))
    Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
    Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
    ObjectContainer.art = R(ART)
    ObjectContainer.title1 = NAME + VERSION
    DirectoryObject.thumb = R(ICON)
    HTTP.CacheTime = 0
    Log.Debug('Misc module is version: %s' % misc.getVersion())
示例#2
0
    def __init__(self, imgDir, start_args):
        # Create the userdir if it doesn't exist
        if not os.path.exists(user_dir):
            os.makedirs(user_dir)

        # Initialize Logs
        initLogs()
        super().__init__()

        # Register the signal handlers
        signal.signal(signal.SIGTERM, service_shutdown)
        signal.signal(signal.SIGINT, service_shutdown)

        # Get version and title
        self.version = getVersion()
        self.title = 'PET4L - PIVX Emergency Tool For Ledger - v.%s-%s' % (
            self.version['number'], self.version['tag'])

        # Open database
        self.db = Database(self)
        self.db.open()

        # Check for startup args (clear data)
        if start_args.clearAppData:
            settings = QSettings('PIVX', 'PET4L')
            settings.clear()

        # Clear DB
        self.db.clearTable('UTXOS')

        # Read cached app data
        self.cache = readCacheSettings()

        # Initialize user interface
        self.initUI(imgDir)
示例#3
0
def Start():
    ''' Start function '''
    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)
    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(locale.getdefaultlocale()),
         ' and file system encoding is % s' % str(sys.getfilesystemencoding()),
         ' **********'))
    if DEBUGMODE:
        try:
            print strLog
        except:
            pass
    Log.Debug(strLog)
    Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
    Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
    ObjectContainer.art = R(ART)
    ObjectContainer.title1 = NAME + VERSION
    DirectoryObject.thumb = R(ICON)
    HTTP.CacheTime = 0
    Log.Debug('Misc module is version: %s' % misc.getVersion())
示例#4
0
def Start():
    #	print("********  Started %s on %s  **********" %(consts.NAME  + consts.VERSION, Platform.OS))
    Log.Debug("*******  Started %s on %s  ***********" %
              (consts.NAME + consts.VERSION, Platform.OS))

    Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
    Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
    ObjectContainer.art = R(consts.ART)
    ObjectContainer.title1 = consts.NAME + consts.VERSION
    DirectoryObject.thumb = R(consts.ICON)
    HTTP.CacheTime = 0
    Log.Debug('Misc module is version: %s' % misc.getVersion())
示例#5
0
def Start():
#	print("********  Started %s on %s  **********" %(consts.NAME  + consts.VERSION, Platform.OS))
	Log.Debug("*******  Started %s on %s  ***********" %(consts.NAME  + consts.VERSION, Platform.OS))


	Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
	Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
	ObjectContainer.art = R(consts.ART)
	ObjectContainer.title1 = consts.NAME  + consts.VERSION
	DirectoryObject.thumb = R(consts.ICON)
	HTTP.CacheTime = 0
	Log.Debug('Misc module is version: %s' %misc.getVersion())
示例#6
0
def Start():
	print("********  Started %s on %s  **********" %(consts.NAME  + consts.VERSION, Platform.OS))
	Log.Debug("*******  Started %s on %s  ***********" %(consts.NAME  + consts.VERSION, Platform.OS))
	Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
	ObjectContainer.art = R(consts.ART)
	ObjectContainer.title1 = consts.NAME  + consts.VERSION
	ObjectContainer.view_group = 'List'
	DirectoryObject.thumb = R(consts.ICON)
	HTTP.CacheTime = 0
	# Get the loopback address
	global LOOPBACK
	LOOPBACK = misc.GetLoopBack()
	Log.Debug('Loopback address is: %s' %(LOOPBACK))
	Log.Debug('Misc module is version: %s' %misc.getVersion())
示例#7
0
文件: mainApp.py 项目: tgroh007/PET4L
 def __init__(self, imgDir):
     super().__init__()
     # Register the signal handlers
     signal.signal(signal.SIGTERM, service_shutdown)
     signal.signal(signal.SIGINT, service_shutdown)
     # Get version and title
     self.version = getVersion()
     self.title = 'PET4L - PIVX Emergency Tool For Ledger - v.%s-%s' % (
         self.version['number'], self.version['tag'])
     # Create the userdir if it doesn't exist
     if not os.path.exists(user_dir):
         os.makedirs(user_dir)
     # Initialize user interface
     self.initUI(imgDir)
示例#8
0
def Start():
	global DEBUGMODE
	# Switch to debug mode if needed
	debugFile = Core.storage.join_path(Core.app_support_path, Core.config.bundles_dir_name, consts.NAME + '.bundle', 'debug')
	DEBUGMODE = os.path.isfile(debugFile)
	if DEBUGMODE:
		VERSION = consts.VERSION + ' ****** WARNING Debug mode on *********'
		print("********  Started %s on %s  **********" %(consts.NAME  + ' ' + VERSION, Platform.OS))
	else:
		VERSION = consts.VERSION
	Log.Debug("*******  Started %s on %s  ***********" %(consts.NAME  + VERSION, Platform.OS))
	Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
	Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
	ObjectContainer.art = R(consts.ART)
	ObjectContainer.title1 = consts.NAME  + consts.VERSION
	DirectoryObject.thumb = R(consts.ICON)
	HTTP.CacheTime = 0
	Log.Debug('Misc module is version: %s' %misc.getVersion())
示例#9
0
def Start():
	global DEBUGMODE
	# Switch to debug mode if needed
	debugFile = Core.storage.join_path(Core.app_support_path, Core.config.bundles_dir_name, consts.NAME + '.bundle', 'debug')
	DEBUGMODE = os.path.isfile(debugFile)
	if DEBUGMODE:
		VERSION = consts.VERSION + ' ****** WARNING Debug mode on *********'
		print("********  Started %s on %s  **********" %(consts.NAME  + ' ' + VERSION, Platform.OS))
	else:
		VERSION = consts.VERSION
	Log.Debug("*******  Started %s on %s  ***********" %(consts.NAME  + VERSION, Platform.OS))
	Plugin.AddViewGroup('List', viewMode='List', mediaType='items')
	Plugin.AddViewGroup("Details", viewMode="InfoList", mediaType="items")
	ObjectContainer.art = R(consts.ART)
	ObjectContainer.title1 = consts.NAME  + consts.VERSION
	DirectoryObject.thumb = R(consts.ICON)
	HTTP.CacheTime = 0
	Log.Debug('Misc module is version: %s' %misc.getVersion())
示例#10
0
    def __init__(self, imgDir, app, start_args):
        # Create the userdir if it doesn't exist
        if not os.path.exists(user_dir):
            os.makedirs(user_dir)

        # Initialize Logs
        initLogs()
        super().__init__()
        self.app = app

        # Register the signal handlers
        signal.signal(signal.SIGTERM, service_shutdown)
        signal.signal(signal.SIGINT, service_shutdown)

        # Get version and title
        self.version = getVersion()
        self.title = 'PET4L - PIVX Emergency Tool For Ledger - v.%s-%s' % (self.version['number'], self.version['tag'])

        # Open database
        self.db = Database(self)
        self.db.openDB()

        # Check for startup args (clear data)
        if start_args.clearAppData:
            settings = QSettings('PIVX', 'PET4L')
            settings.clear()

        if start_args.clearTxCache:
            self.db.clearTable('RAWTXES')

        # Clear DB
        self.db.clearTable('UTXOS')

        # Remove raw txes updated earlier than two months ago (if not already cleared)
        if not start_args.clearTxCache:
            self.db.clearRawTxes(time() - SECONDS_IN_2_MONTHS)

        # Read cached app data
        self.cache = readCacheSettings()

        # Initialize user interface
        self.initUI(imgDir)
示例#11
0
文件: dump.py 项目: kesara10/ToMaTo
def init():
    dump_lib.init(envCmds,"Backend",misc.getVersion())
示例#12
0
文件: dump.py 项目: tonyduncan/ToMaTo
def init():
    dump_lib.init(envCmds, "Backend", misc.getVersion())