#NEWLINE# def run( self , type , paths = [ ] ) : #NEWLINE# #INDENT# self . targetTemplate = type #NEWLINE# folders = self . window . folders ( ) #NEWLINE# if ( len ( paths ) == 0 ) : #NEWLINE# #INDENT# if ( len ( folders ) == 0 ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . targetFolder = folders [ 0 ] #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for path in paths : #NEWLINE# #INDENT# self . targetFolder = '' #NEWLINE# if os . path . isfile ( path ) : #NEWLINE# #INDENT# self . targetFolder = os . path . dirname ( path ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . targetFolder = path #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# header = '' #NEWLINE# if ( type == 'app' ) : #NEWLINE# #INDENT# header = 'Choose a project name:' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type == 'uno' ) : #NEWLINE# #INDENT# header = 'Choose a class name:' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# header = 'Choose a file name:' #NEWLINE# #UNINDENT# #UNINDENT# self . window . show_input_panel ( header , '' , self . on_done , None , None )