#NEWLINE# def selectLocally( self ) : #NEWLINE# #INDENT# choices = [ ] #NEWLINE# def sortOrder( key ) : #NEWLINE# #INDENT# return ( { #NEWLINE# #INDENT# 'EdgarRenderer' : '1' , #NEWLINE# 'validate' : '2' , #NEWLINE# 'xbrlDB' : '3' , #NEWLINE# #UNINDENT# } . get ( key , '4' ) + key . lower ( ) ) #NEWLINE# #UNINDENT# def selectChoices( dir , indent = '' ) : #NEWLINE# #INDENT# dirHasEntries = False #NEWLINE# for f in sorted ( os . listdir ( dir ) , key = sortOrder ) : #NEWLINE# #INDENT# if ( f not in ( '.' , '..' , '__pycache__' , '__init__.py' ) ) : #NEWLINE# #INDENT# fPath = os . path . join ( dir , f ) #NEWLINE# fPkgInit = os . path . join ( fPath , '__init__.py' ) #NEWLINE# dirInsertPoint = len ( choices ) #NEWLINE# moduleInfo = None #NEWLINE# if ( ( os . path . isdir ( fPath ) and os . path . exists ( fPkgInit ) ) or ( os . path . isfile ( fPath ) and f . endswith ( '.py' ) ) ) : #NEWLINE# #INDENT# moduleInfo = PluginManager . moduleModuleInfo ( fPath ) #NEWLINE# if moduleInfo : #NEWLINE# #INDENT# choices . append ( ( ( indent + f ) , 'name: {}\ndescription: {}\nversion: {}\nlicense: {}' . format ( moduleInfo [ 'name' ] , moduleInfo [ 'description' ] , moduleInfo . get ( 'version' ) , moduleInfo . get ( 'license' ) ) , fPath , moduleInfo [ 'name' ] , moduleInfo . get ( 'version' ) , moduleInfo [ 'description' ] , moduleInfo . get ( 'license' ) ) ) #NEWLINE# dirHasEntries = True #NEWLINE# #UNINDENT# #UNINDENT# if ( os . path . isdir ( fPath ) and ( f not in ( 'DQC_US_Rules' , ) ) ) : #NEWLINE# #INDENT# if ( selectChoices ( fPath , indent = ( indent + '   ' ) ) and ( not moduleInfo ) ) : #NEWLINE# #INDENT# choices . insert ( dirInsertPoint , ( ( indent + f ) , None , None , None , None , None , None ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return dirHasEntries #NEWLINE# #UNINDENT# selectChoices ( self . cntlr . pluginDir ) #NEWLINE# selectedPath = DialogOpenArchive . selectPlugin ( self , choices ) #NEWLINE# if selectedPath : #NEWLINE# #INDENT# moduleInfo = PluginManager . moduleModuleInfo ( selectedPath ) #NEWLINE# self . loadFoundModuleInfo ( moduleInfo , selectedPath )