#NEWLINE# def backgroundLoadXbrl( self , filesource , importToDTS , selectTopView ) : #NEWLINE# #INDENT# startedAt = time . time ( ) #NEWLINE# try : #NEWLINE# #INDENT# if importToDTS : #NEWLINE# #INDENT# action = _ ( 'imported' ) #NEWLINE# profileStat = 'import' #NEWLINE# modelXbrl = self . modelManager . modelXbrl #NEWLINE# if modelXbrl : #NEWLINE# #INDENT# ModelDocument . load ( modelXbrl , filesource . url , isSupplemental = importToDTS ) #NEWLINE# modelXbrl . relationshipSets . clear ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# action = _ ( 'loaded' ) #NEWLINE# profileStat = 'load' #NEWLINE# modelXbrl = self . modelManager . load ( filesource , _ ( 'views loading' ) ) #NEWLINE# #UNINDENT# #UNINDENT# except ModelDocument . LoadingException : #NEWLINE# #INDENT# self . showStatus ( _ ( 'Loading terminated, unrecoverable error' ) , 20000 ) #NEWLINE# return #NEWLINE# #UNINDENT# except Exception as err : #NEWLINE# #INDENT# msg = _ ( 'Exception loading {0}: {1}, at {2}' ) . format ( filesource . url , err , traceback . format_tb ( sys . exc_info ( ) [ 2 ] ) ) #NEWLINE# self . addToLog ( msg ) #NEWLINE# self . showStatus ( _ ( 'Loading terminated, unrecoverable error' ) , 20000 ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( modelXbrl and modelXbrl . modelDocument ) : #NEWLINE# #INDENT# statTime = ( time . time ( ) - startedAt ) #NEWLINE# modelXbrl . profileStat ( profileStat , statTime ) #NEWLINE# self . addToLog ( format_string ( self . modelManager . locale , _ ( '%s in %.2f secs' ) , ( action , statTime ) ) ) #NEWLINE# if modelXbrl . hasTableRendering : #NEWLINE# #INDENT# self . showStatus ( _ ( 'Initializing table rendering' ) ) #NEWLINE# RenderingEvaluator . init ( modelXbrl ) #NEWLINE# #UNINDENT# self . showStatus ( _ ( '{0}, preparing views' ) . format ( action ) ) #NEWLINE# self . waitForUiThreadQueue ( ) #NEWLINE# self . uiThreadQueue . put ( ( self . showLoadedXbrl , [ modelXbrl , importToDTS , selectTopView ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . addToLog ( format_string ( self . modelManager . locale , _ ( 'not successfully %s in %.2f secs' ) , ( action , ( time . time ( ) - startedAt ) ) ) )