Ejemplo n.º 1
0
 def on_import_ascii(self):
     dlg = wx.FileDialog(self._widget, message="Choose a file", defaultDir=os.getcwd(), 
                         defaultFile="", wildcard="All Files|*.*|Projects|*.gt", style=wx.OPEN | wx.CHANGE_DIR)
     if dlg.ShowModal() == wx.ID_OK:
         ws = self.project.new(Worksheet, None, self.project.here)
         path = dlg.GetPaths()[0]
         ws.array, ws._header = import_ascii(path)
     dlg.Destroy()
Ejemplo n.º 2
0
 def on_dropped(self, item, data):
     if 'grafit-object' in data.formats:
         parent = self.list.model[item]
         for d in data.get('grafit-object').split('\n'):
             self.project.items[d].parent = parent
         return True
     elif 'filename' in data.formats and item == -1:
         # import ascii
         for path in data.get('filename'):
             ws = self.project.new(Worksheet, str(os.path.basename(path).split('.')[0]), self.project.here)
             ws.array, ws._header = import_ascii(path)
         return False
     else:
         return False
Ejemplo n.º 3
0
 def import_ascii(self, filename, **kwds):
     self.array, self._header = import_ascii(filename, **kwds)
Ejemplo n.º 4
0
 def import_ascii(self, filename, **kwds):
     self.array, self._header = import_ascii(filename, **kwds)