#NEWLINE# def loadFileMenuHistory( self ) : #NEWLINE# #INDENT# self . fileMenu . delete ( self . fileMenuLength , ( self . fileMenuLength + 2 ) ) #NEWLINE# fileHistory = self . config . setdefault ( 'fileHistory' , [ ] ) #NEWLINE# self . recentFilesMenu = Menu ( self . menubar , tearoff = 0 ) #NEWLINE# for i in range ( min ( len ( fileHistory ) , 10 ) ) : #NEWLINE# #INDENT# self . recentFilesMenu . add_command ( label = fileHistory [ i ] , command = ( lambda j = i : self . fileOpenFile ( self . config [ 'fileHistory' ] [ j ] ) ) ) #NEWLINE# #UNINDENT# self . fileMenu . add_cascade ( label = _ ( 'Recent files' ) , menu = self . recentFilesMenu , underline = 0 ) #NEWLINE# importHistory = self . config . setdefault ( 'importHistory' , [ ] ) #NEWLINE# self . recentAttachMenu = Menu ( self . menubar , tearoff = 0 ) #NEWLINE# for i in range ( min ( len ( importHistory ) , 10 ) ) : #NEWLINE# #INDENT# self . recentAttachMenu . add_command ( label = importHistory [ i ] , command = ( lambda j = i : self . fileOpenFile ( self . config [ 'importHistory' ] [ j ] , importToDTS = True ) ) ) #NEWLINE# #UNINDENT# self . fileMenu . add_cascade ( label = _ ( 'Recent imports' ) , menu = self . recentAttachMenu , underline = 0 ) #NEWLINE# self . packagesMenu = Menu ( self . menubar , tearoff = 0 ) #NEWLINE# hasPackages = False #NEWLINE# for ( i , packageInfo ) in enumerate ( sorted ( PackageManager . packagesConfig . get ( 'packages' , [ ] ) , key = ( lambda packageInfo : packageInfo . get ( 'name' ) ) ) , start = 1 ) : #NEWLINE# #INDENT# name = packageInfo . get ( 'name' , 'package{}' . format ( i ) ) #NEWLINE# URL = packageInfo . get ( 'URL' ) #NEWLINE# if ( fileHistory and URL and ( packageInfo . get ( 'status' ) == 'enabled' ) ) : #NEWLINE# #INDENT# self . packagesMenu . add_command ( label = name , command = ( lambda url = URL : self . fileOpenFile ( url ) ) ) #NEWLINE# hasPackages = True #NEWLINE# #UNINDENT# #UNINDENT# if hasPackages : #NEWLINE# #INDENT# self . fileMenu . add_cascade ( label = _ ( 'Packages' ) , menu = self . packagesMenu , underline = 0 )