parameters: (self)
docstring: This method checks for any .zip files in the modules directory
docstring_summary: This method checks for any .zip files in the modules directory
docstring_tokens: This method checks for any . zip files in the modules directory
function: def loadArmoryModules(self):
        """
        This method checks for any .zip files in the modules directory
        """ 
        modulesZipDirPath = os.path.join(GetExecDir(), MODULES_ZIP_DIR_NAME)
        if modulesZipDirPath and os.path.exists(modulesZipDirPath):
           
           self.tempModulesDirName = tempfile.mkdtemp('modules')
  
     
           # This call does not eval any code in the modules.  It simply
           # loads the python files as raw chunks of text so we can
           # check hashes and signatures
           modMap = getModuleList(modulesZipDirPath)
           for moduleName,infoMap in modMap.iteritems():
              moduleZipPath = os.path.join(modulesZipDirPath, infoMap[MODULE_PATH_KEY])
              if  infoMap[MODULE_ZIP_STATUS_KEY] == MODULE_ZIP_STATUS.Invalid:
                 reply = QMessageBox.warning(self, tr("Invalid Module"), tr("""
                    Armory detected the following module which is 
                    <font color=%(color)s"><b>invalid</b></font>:
                    <br><br>
                       <b>Module Name:</b> %(name)s<br>
                       <b>Module Path:</b> %(path)s<br>
                    <br><br>
                    Armory will only run a module from a zip file that
                    has the required stucture.""") % \
                    { 'color' : htmlColor('TextRed'), 'name' : moduleName, 'path' : moduleZipPath}, QMessageBox.Ok)
              elif not USE_TESTNET and infoMap[MODULE_ZIP_STATUS_KEY] == MODULE_ZIP_STATUS.Unsigned:
                 reply = QMessageBox.warning(self, tr("UNSIGNED Module"), tr("""
                    Armory detected the following module which  
                    <font color="%(color)s"><b>has not been signed by Armory</b></font> and may be dangerous:
                    <br><br>
                       <b>Module Name:</b> %(name)s<br>
                       <b>Module Path:</b> %(path)s<br>
                    <br><br>
                    Armory will not allow you to run this module.""") % \
                    { 'color' : htmlColor('TextRed'), 'name' : moduleName, 'path' : moduleZipPath}, QMessageBox.Ok)
              else:
     
                 ZipFile(moduleZipPath).extract(INNER_ZIP_FILENAME, self.tempModulesDirName)
                 ZipFile(os.path.join(self.tempModulesDirName,INNER_ZIP_FILENAME)).extractall(self.tempModulesDirName)
                 
                 plugin = importModule(self.tempModulesDirName, moduleName, globals())
                 plugObj = plugin.PluginObject(self)
        
                 if not hasattr(plugObj,'getTabToDisplay') or \
                    not hasattr(plugObj,'tabName'):
                    LOGERROR('Module is malformed!  No tabToDisplay or tabName attrs')
                    QMessageBox.critmoduleName(self, tr("Bad Module"), tr("""
                       The module you attempted to load (%s) is malformed.  It is 
                       missing attributes that are needed for Armory to load it.  
                       It will be skipped.""") % moduleName, QMessageBox.Ok)
                    continue
                       
                 verPluginInt = getVersionInt(readVersionString(plugObj.maxVersion))
                 verArmoryInt = getVersionInt(BTCARMORY_VERSION)
                 if verArmoryInt >verPluginInt:
                    reply = QMessageBox.warning(self, tr("Outdated Module"), tr("""
                       Module %(mod)s is only specified to work up to Armory version %(maxver)s.
                       You are using Armory version %(curver)s.  Please remove the module if
                       you experience any problems with it, or contact the maintainer
                       for a new version.
                       <br><br>
                       Do you want to continue loading the module?""") \
                          % { 'mod' : moduleName, 'maxver' : plugObj.maxVersion, 
                                   'curver' : getVersionString(BTCARMORY_VERSION)} , 
                             QMessageBox.Yes | QMessageBox.No)
        
                    if not reply==QMessageBox.Yes:
                       continue
        
                 # All plugins should have "tabToDisplay" and "tabName" attributes
                 LOGWARN('Adding module to tab list: "' + plugObj.tabName + '"')
                 self.mainDisplayTabs.addTab(plugObj.getTabToDisplay(), plugObj.tabName)
        
                 # Also inject any extra methods that will be 
                 injectFuncList = [ \
                       ['injectHeartbeatAlwaysFunc', 'extraHeartbeatAlways'], 
                       ['injectHeartbeatOnlineFunc', 'extraHeartbeatOnline'], 
                       ['injectGoOnlineFunc',        'extraGoOnlineFunctions'], 
                       ['injectNewTxFunc',           'extraNewTxFunctions'], 
                       ['injectNewBlockFunc',        'extraNewBlockFunctions'], 
                       ['injectShutdownFunc',        'extraShutdownFunctions'] ]
        
                 # Add any methods
                 for plugFuncName,funcListName in injectFuncList:
                    if not hasattr(plugObj, plugFuncName):
                       continue
              
                    if not hasattr(self, funcListName):
                       LOGERROR('Missing an ArmoryQt list variable: %s' % funcListName)
                       continue
        
                    LOGINFO('Found module function: %s' % plugFuncName)
                    funcList = getattr(self, funcListName)
                    plugFunc = getattr(plugObj, plugFuncName)
                    funcList.append(plugFunc)
function_tokens: def loadArmoryModules ( self ) : modulesZipDirPath = os . path . join ( GetExecDir ( ) , MODULES_ZIP_DIR_NAME ) if modulesZipDirPath and os . path . exists ( modulesZipDirPath ) : self . tempModulesDirName = tempfile . mkdtemp ( 'modules' ) # This call does not eval any code in the modules.  It simply # loads the python files as raw chunks of text so we can # check hashes and signatures modMap = getModuleList ( modulesZipDirPath ) for moduleName , infoMap in modMap . iteritems ( ) : moduleZipPath = os . path . join ( modulesZipDirPath , infoMap [ MODULE_PATH_KEY ] ) if infoMap [ MODULE_ZIP_STATUS_KEY ] == MODULE_ZIP_STATUS . Invalid : reply = QMessageBox . warning ( self , tr ( "Invalid Module" ) , tr ( """
                    Armory detected the following module which is 
                    <font color=%(color)s"><b>invalid</b></font>:
                    <br><br>
                       <b>Module Name:</b> %(name)s<br>
                       <b>Module Path:</b> %(path)s<br>
                    <br><br>
                    Armory will only run a module from a zip file that
                    has the required stucture.""" ) % { 'color' : htmlColor ( 'TextRed' ) , 'name' : moduleName , 'path' : moduleZipPath } , QMessageBox . Ok ) elif not USE_TESTNET and infoMap [ MODULE_ZIP_STATUS_KEY ] == MODULE_ZIP_STATUS . Unsigned : reply = QMessageBox . warning ( self , tr ( "UNSIGNED Module" ) , tr ( """
                    Armory detected the following module which  
                    <font color="%(color)s"><b>has not been signed by Armory</b></font> and may be dangerous:
                    <br><br>
                       <b>Module Name:</b> %(name)s<br>
                       <b>Module Path:</b> %(path)s<br>
                    <br><br>
                    Armory will not allow you to run this module.""" ) % { 'color' : htmlColor ( 'TextRed' ) , 'name' : moduleName , 'path' : moduleZipPath } , QMessageBox . Ok ) else : ZipFile ( moduleZipPath ) . extract ( INNER_ZIP_FILENAME , self . tempModulesDirName ) ZipFile ( os . path . join ( self . tempModulesDirName , INNER_ZIP_FILENAME ) ) . extractall ( self . tempModulesDirName ) plugin = importModule ( self . tempModulesDirName , moduleName , globals ( ) ) plugObj = plugin . PluginObject ( self ) if not hasattr ( plugObj , 'getTabToDisplay' ) or not hasattr ( plugObj , 'tabName' ) : LOGERROR ( 'Module is malformed!  No tabToDisplay or tabName attrs' ) QMessageBox . critmoduleName ( self , tr ( "Bad Module" ) , tr ( """
                       The module you attempted to load (%s) is malformed.  It is 
                       missing attributes that are needed for Armory to load it.  
                       It will be skipped.""" ) % moduleName , QMessageBox . Ok ) continue verPluginInt = getVersionInt ( readVersionString ( plugObj . maxVersion ) ) verArmoryInt = getVersionInt ( BTCARMORY_VERSION ) if verArmoryInt > verPluginInt : reply = QMessageBox . warning ( self , tr ( "Outdated Module" ) , tr ( """
                       Module %(mod)s is only specified to work up to Armory version %(maxver)s.
                       You are using Armory version %(curver)s.  Please remove the module if
                       you experience any problems with it, or contact the maintainer
                       for a new version.
                       <br><br>
                       Do you want to continue loading the module?""" ) % { 'mod' : moduleName , 'maxver' : plugObj . maxVersion , 'curver' : getVersionString ( BTCARMORY_VERSION ) } , QMessageBox . Yes | QMessageBox . No ) if not reply == QMessageBox . Yes : continue # All plugins should have "tabToDisplay" and "tabName" attributes LOGWARN ( 'Adding module to tab list: "' + plugObj . tabName + '"' ) self . mainDisplayTabs . addTab ( plugObj . getTabToDisplay ( ) , plugObj . tabName ) # Also inject any extra methods that will be  injectFuncList = [ [ 'injectHeartbeatAlwaysFunc' , 'extraHeartbeatAlways' ] , [ 'injectHeartbeatOnlineFunc' , 'extraHeartbeatOnline' ] , [ 'injectGoOnlineFunc' , 'extraGoOnlineFunctions' ] , [ 'injectNewTxFunc' , 'extraNewTxFunctions' ] , [ 'injectNewBlockFunc' , 'extraNewBlockFunctions' ] , [ 'injectShutdownFunc' , 'extraShutdownFunctions' ] ] # Add any methods for plugFuncName , funcListName in injectFuncList : if not hasattr ( plugObj , plugFuncName ) : continue if not hasattr ( self , funcListName ) : LOGERROR ( 'Missing an ArmoryQt list variable: %s' % funcListName ) continue LOGINFO ( 'Found module function: %s' % plugFuncName ) funcList = getattr ( self , funcListName ) plugFunc = getattr ( plugObj , plugFuncName ) funcList . append ( plugFunc )