Beispiel #1
0
  def selectTempDir(self):
    
    popup = FileSelectPopup(self, show_file=False)

    directory = popup.getDirectory()
    if directory:
      self.tempDirEntry.set( directory )
    
    popup.destroy()
    self.updateEntryParams()
Beispiel #2
0
    def selectWorkingDir(self):

        popup = FileSelectPopup(self, show_file=False)

        directory = popup.getDirectory()
        if directory:
            self.workingDirEntry.set(directory)

        popup.destroy()
        self.updateAfter()
Beispiel #3
0
    def getDirectory(self, widget, obj, attrName):
        """Is called by updateGeneral. No widget because table placement is irrelevent and setting process not interruptable"""

        value = getattr(obj, attrName)
        if not os.path.exists(value): value = None

        popup = FileSelectPopup(self, directory=value, show_file=False)
        value = popup.getDirectory()
        if value:
            setattr(obj, attrName, value)
Beispiel #4
0
    def chooseDirectory(self):

        directory = os.path.dirname(self.fileName)
        if not directory:
            directory = os.getcwd()
        popup = FileSelectPopup(self, directory=directory, show_file=False)
        directory = popup.getDirectory()
        popup.destroy()

        if directory:
            self.directoryEntry.set(directory)
Beispiel #5
0
def askDir(title, prompt, initial_value = '', parent = None,
           dismiss_text='Cancel', extra_dismiss_text = '', default_dir = None):

  if (parent):
    popup = FileSelectPopup(parent, title=title, prompt=prompt, show_file=False,
                            dismiss_text=dismiss_text,
                            extra_dismiss_text=extra_dismiss_text,
                            file=initial_value, default_dir = default_dir)

    dir = popup.getDirectory()
    popup.destroy()
    return dir
  else:
    return askString(title, prompt, initial_value)
Beispiel #6
0
    def getDataUrl(self, *extra):

        if self.dataStore:
            dataStore = self.dataStore
            oldPath = dataStore.dataUrl.url.dataLocation
            if os.path.exists(oldPath):
                directory = oldPath
            elif os.path.exists(os.path.dirname(oldPath)):
                directory = os.path.dirname(oldPath)
            else:
                directory = None
            popup = FileSelectPopup(self, directory=directory, show_file=False)
            newPath = popup.getDirectory()
            popup.destroy()
            if newPath and oldPath != newPath:
                changeDataStoreUrl(dataStore, newPath)
Beispiel #7
0
    def export_project(self):

        # get the selected node
        selected_nodes = self.repTree.getSelectedNodes()

        # restrict the choice to one
        node = selected_nodes[0]

        # we really need to traverse the tree a lot more carefully
        name = node.parent.object.__str__()
        versionTag = node.object.__str__()[len(name) + 2:]

        # need to preserve the current status. Take a default from the
        # Wms layer
        rootDir = self.basePopup.repList.current_export_dir

        # This should be obtained from a query box. Hard code for now
        fileSelectPopup = FileSelectPopup(self, None, rootDir)

        exp_project_dir = fileSelectPopup.getDirectory()
        self.basePopup.repList.current_export_dir = exp_project_dir

        self.repository.export_project(name, versionTag, exp_project_dir)