Exemplo n.º 1
0
    def OnExportZopeItem(self, event):
        if self.list.node:
            idxs = self.list.getMultiSelection()
            currPath = '.'
            for idx in idxs:
                item = self.list.items[idx]
                if item:
                    zexp = item.exportObj()

                    from FileDlg import wxFileDialog
                    dlg = wxFileDialog(self.list, 'Save as...', currPath,
                          item.name+'.zexp', '', wx.SAVE | wx.OVERWRITE_PROMPT)
                    try:
                        if dlg.ShowModal() == wx.ID_OK:
                            zexpFile = dlg.GetFilePath()
                            open(zexpFile, 'wb').write(zexp)
                            currPath = os.path.dirname(zexpFile)
                    finally:
                        dlg.Destroy()
Exemplo n.º 2
0
    def OnExportZopeItem(self, event):
        if self.list.node:
            idxs = self.list.getMultiSelection()
            currPath = '.'
            for idx in idxs:
                item = self.list.items[idx]
                if item:
                    zexp = item.exportObj()

                    from FileDlg import wxFileDialog
                    dlg = wxFileDialog(self.list, 'Save as...', currPath,
                                       item.name + '.zexp', '',
                                       wx.SAVE | wx.OVERWRITE_PROMPT)
                    try:
                        if dlg.ShowModal() == wx.ID_OK:
                            zexpFile = dlg.GetFilePath()
                            open(zexpFile, 'wb').write(zexp)
                            currPath = os.path.dirname(zexpFile)
                    finally:
                        dlg.Destroy()
Exemplo n.º 3
0
 def OnUploadZopeItem(self, event):
     if self.list.node:
         idxs = self.list.getMultiSelection()
         currPath = '.'
         for idx in idxs:
             item = self.list.items[idx]
             if item:
                 from FileDlg import wxFileDialog
                 dlg = wxFileDialog(self.list, 'Upload '+item.name, currPath,
                       item.name, '', wx.OPEN)
                 try:
                     if dlg.ShowModal() == wx.ID_OK:
                         try:
                             # XXX Update to handle all transports
                             item.uploadObj(open(dlg.GetFilePath(), 'rb'))#.read())
                         except Client.NotFound:
                             wx.MessageBox('Object does not support uploading', 'Error on upload')
                         currPath = dlg.GetDirectory()
                 finally:
                     dlg.Destroy()
Exemplo n.º 4
0
 def OnUploadZopeItem(self, event):
     if self.list.node:
         idxs = self.list.getMultiSelection()
         currPath = '.'
         for idx in idxs:
             item = self.list.items[idx]
             if item:
                 from FileDlg import wxFileDialog
                 dlg = wxFileDialog(self.list, 'Upload ' + item.name,
                                    currPath, item.name, '', wx.OPEN)
                 try:
                     if dlg.ShowModal() == wx.ID_OK:
                         try:
                             # XXX Update to handle all transports
                             item.uploadObj(open(dlg.GetFilePath(),
                                                 'rb'))  #.read())
                         except Client.NotFound:
                             wx.MessageBox(
                                 'Object does not support uploading',
                                 'Error on upload')
                         currPath = dlg.GetDirectory()
                 finally:
                     dlg.Destroy()