def perform(self, event): """ Perform the action. """ # Note that we always offer the service via its name, but look it up # via the actual protocol. from puddle.resource.i_workspace import IWorkspace workspace = self.window.application.get_service(IWorkspace) ds = DirectorySelection(directory=dirname(workspace.absolute_path)) retval = ds.edit_traits(parent=self.window.control, kind="livemodal") if retval.result: workspace.path = ds.directory # Refresh the workspace tree view view = self.window.get_view_by_id(RESOURCE_VIEW) if view is not None: view.tree_viewer.refresh(workspace)
def perform(self, event): """ Perform the action. """ selection = self.window.selection[0] ds = DirectorySelection(directory=dirname(selection.absolute_path)) retval = ds.edit_traits(parent=self.window.control, kind="livemodal") if retval.result: destination = join(ds.directory, selection.name+selection.ext) selection.copy(destination) # Refresh the workspace tree view view = self.window.get_view_by_id(RESOURCE_VIEW) if view is not None: # Note that we always offer the service via its name, but look # it up via the actual protocol. from puddle.resource.i_workspace import IWorkspace # Refresh the parent directory and not the whole tree view.tree_viewer.refresh(workspace)