Exemplo n.º 1
0
def onLoadFile(self, e=None, file=''):
    from ifigure.utils.addon_utils import onLoadFile

    if file != '':
        self.td.set_path_pathmode(file, modename, pathname, extname)
        ret = True
    else:
        cwd = os.getcwd()
        if self.td.has_owndir():
            os.chdir(self.td.owndir())
        try:
            ret = onLoadFile(self.td,
                             message="Select G-File",
                             modename=modename,
                             pathname=pathname,
                             extname=extname)
        except:
            import traceback
            traceback.print_exc()
            pass
        os.chdir(cwd)

    if not ret:
        return False

    load_gfile(self.td)
Exemplo n.º 2
0
    def onImportScriptFile(self, e=None, file = None):
        from ifigure.utils.addon_utils import onLoadFile
        ret = onLoadFile(self, message="Enter script file name", 
                         modename = 'pathmode',
                         pathname = 'path',
                         extname  = '.py',
                         reject_loc = ['wdir', 'owndir'],
                         file = file,
                         wildcard='*.py')

        if not ret: return
        file=self.path2fullpath()
        if self.getvar('pathmode') == 'owndir':
            newname = str(os.path.basename(file).split('.')[0])
            self.rename(newname)
        else:
            self.load_script(file)
#        ifigure.events.SendFileSystemChangedEvent(self)
#        self.load_script(file)
        return
        file = dialog.read(None, message="Select script", 
                             wildcard='*.py')
        mode, path = FileHolder.fullpath2path(self, file)
        if (mode == 'wdir' or mode == 'owndir'):
           m = 'Import should import from somewhere outside project directory',
           ret=dialog.message(None, message=m, 
               title='Import error')
           return
        self.import_script(file)
Exemplo n.º 3
0
    def onImportScriptFile(self, e=None, file=None):
        from ifigure.utils.addon_utils import onLoadFile
        ret = onLoadFile(self,
                         message="Enter script file name",
                         modename='pathmode',
                         pathname='path',
                         extname='.py',
                         reject_loc=['wdir', 'owndir'],
                         file=file,
                         wildcard='*.py')

        if not ret:
            return
        file = self.path2fullpath()
        if self.getvar('pathmode') == 'owndir':
            newname = str(os.path.basename(file).split('.')[0])
            self.rename(newname)
        else:
            self.load_script(file)
#        ifigure.events.SendFileSystemChangedEvent(self)
#        self.load_script(file)
        return
        file = dialog.read(None, message="Select script", wildcard='*.py')
        mode, path = FileHolder.fullpath2path(self, file)
        if (mode == 'wdir' or mode == 'owndir'):
            m = 'Import should import from somewhere outside project directory',
            ret = dialog.message(None, message=m, title='Import error')
            return
        self.import_script(file)
Exemplo n.º 4
0
def onLoadFile(self, e):
    from ifigure.utils.addon_utils import onLoadFile
 
    ret = onLoadFile(self.td, message="Select .sav File", 
                   modename = modename,
                   pathname = pathname,
                   extname  = extname, 
                   wildcard = wildcard,
                   ask_org_copy = False   )
    if ret:
        load_matfile(self.td)
        ifigure.events.SendChangedEvent(self.td)
Exemplo n.º 5
0
def onLoadFile(self, e=None, file=''):
    from ifigure.utils.addon_utils import onLoadFile

    if file != '':
       self.td.set_path_pathmode(file, modename, pathname, extname)
       ret = True
    else:
       ret = onLoadFile(self.td, message="Select Namelist File", 
                   modename = modename,
                   pathname = pathname,
                   extname  = extname)
    if ret: 
       load_tscinputfile(self.td)
Exemplo n.º 6
0
def onLoadFile(self, e=None, file=''):
    from ifigure.utils.addon_utils import onLoadFile

    if file != '':
        self.td.set_path_pathmode(file, modename, pathname, extname)
        ret = True
    else:
        ret = onLoadFile(self.td, message="Select Namelist File",
                         modename=modename,
                         pathname=pathname,
                         extname=extname)
    if ret:
        load_namelistfile(self.td)
Exemplo n.º 7
0
def onLoadFile(self, e):
    from ifigure.utils.addon_utils import onLoadFile

    ret = onLoadFile(self.td,
                     message="Select .sav File",
                     modename=modename,
                     pathname=pathname,
                     extname=extname,
                     wildcard=wildcard,
                     ask_org_copy=False)
    if ret:
        load_matfile(self.td)
        ifigure.events.SendChangedEvent(self.td)
Exemplo n.º 8
0
def onLoadFile(self, e = None, file = '', checklist=None):
    from ifigure.utils.addon_utils import onLoadFile
    if file != '':
       self.td.set_path_pathmode(file, modename, pathname, extname, 
                                 checklist=checklist)
       ret = True
    else:
       ret = onLoadFile(self.td, message="Select .mat File", 
                   modename = modename,
                   pathname = pathname,
                   extname  = extname, 
                   wildcard = wildcard,
                   ask_org_copy = True )
    if ret:
        load_matfile(self.td)
        ifigure.events.SendChangedEvent(self.td)
Exemplo n.º 9
0
def onLoadFile(self, e=None, file = ''):
    from ifigure.utils.addon_utils import onLoadFile
 
    if file != '':
       self.td.set_path_pathmode(file, modename, pathname, extname)
       ret = True
    else:
       ret = onLoadFile(self.td, message="Select CSV File", 
                   modename = modename,
                   pathname = pathname,
                   extname  = extname, 
                   wildcard='csv(*.csv)|*.csv|Any|*',
                   ask_org_copy = True  )
    if ret:
        load_csv_file(self.td)
        ifigure.events.SendChangedEvent(self.td)
Exemplo n.º 10
0
def onLoadFile(self, e=None, file = ''):
    from ifigure.utils.addon_utils import onLoadFile
 
    if file != '':
       self.td.set_path_pathmode(file, modename, pathname, extname)
       ret = True
    else:
       ret = onLoadFile(self.td, message="Select NETCDF4 File", 
                   modename = modename,
                   pathname = pathname,
                   extname  = extname, 
                   wildcard='nc(*.nc)|*.nc|nc.gz(*.nc.gz)|*.nc.gz|cdf(*.cdf)|*.cdf|Any|*',
                   )
    if ret:
        load_netcdf_file(self.td)
        ifigure.events.SendChangedEvent(self.td)
Exemplo n.º 11
0
def onLoadFile(self, e=None, file=''):
    from ifigure.utils.addon_utils import onLoadFile

    if file != '':
        self.td.set_path_pathmode(file, modename, pathname, extname)
        ret = True
    else:
        ret = onLoadFile(self.td,
                         message="Select CSV File",
                         modename=modename,
                         pathname=pathname,
                         extname=extname,
                         wildcard='csv(*.csv)|*.csv|Any|*',
                         ask_org_copy=True)
    if ret:
        load_csv_file(self.td)
        ifigure.events.SendChangedEvent(self.td)
Exemplo n.º 12
0
def onLoadFile(self, e=None, file=''):
    from ifigure.utils.addon_utils import onLoadFile

    if file != '':
        self.td.set_path_pathmode(file, modename, pathname, extname)
        ret = True
    else:
        ret = onLoadFile(
            self.td,
            message="Select NETCDF4 File",
            modename=modename,
            pathname=pathname,
            extname=extname,
            wildcard=
            'nc(*.nc)|*.nc|nc.gz(*.nc.gz)|*.nc.gz|cdf(*.cdf)|*.cdf|Any|*',
        )
    if ret:
        load_netcdf_file(self.td)
        ifigure.events.SendChangedEvent(self.td)
Exemplo n.º 13
0
def onLoadFile(self, e=None, file=''):
    from ifigure.utils.addon_utils import onLoadFile

    if file != '':
       self.td.set_path_pathmode(file, modename, pathname, extname)
       ret = True
    else:
       cwd = os.getcwd()
       if self.td.has_owndir():
           os.chdir(self.td.owndir())
       try:
           ret = onLoadFile(self.td, message="Select G-File", 
                   modename = modename,
                   pathname = pathname,
                   extname  = extname)
       except:
           import traceback
           traceback.print_exc()
           pass
       os.chdir(cwd)
       
    if not ret: return False
    
    load_gfile(self.td)