当前位置: 首页>>代码示例>>Python>>正文


Python compat.getexistingdirectory函数代码示例

本文整理汇总了Python中spyderlib.qt.compat.getexistingdirectory函数的典型用法代码示例。如果您正苦于以下问题:Python getexistingdirectory函数的具体用法?Python getexistingdirectory怎么用?Python getexistingdirectory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getexistingdirectory函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: move

 def move(self, fnames=None):
     """Move files/directories"""
     if fnames is None:
         fnames = self.get_selected_filenames()
     orig = fixpath(osp.dirname(fnames[0]))
     while True:
         self.parent_widget.redirect_stdio.emit(False)
         folder = getexistingdirectory(self, _("Select directory"), orig)
         self.parent_widget.redirect_stdio.emit(True)
         if folder:
             folder = fixpath(folder)
             if folder != orig:
                 break
         else:
             return
     for fname in fnames:
         basename = osp.basename(fname)
         try:
             misc.move_file(fname, osp.join(folder, basename))
         except EnvironmentError as error:
             QMessageBox.critical(
                 self,
                 _("Error"),
                 _("<b>Unable to move <i>%s</i></b>" "<br><br>Error message:<br>%s")
                 % (basename, to_text_string(error)),
             )
开发者ID:sonofeft,项目名称:spyder,代码行数:26,代码来源:explorer.py

示例2: select_directory

 def select_directory(self):
     """Select directory"""
     self.redirect_stdio.emit(False)
     directory = getexistingdirectory(self.main, _("Select directory"), getcwd())
     if directory:
         self.chdir(directory)
     self.redirect_stdio.emit(True)
开发者ID:WuShichao,项目名称:spyder,代码行数:7,代码来源:workingdirectory.py

示例3: set_current_working_directory

 def set_current_working_directory(self):
     """Set current working directory"""
     cwd = self.shell.get_cwd()
     self.redirect_stdio.emit(False)
     directory = getexistingdirectory(self, _("Select directory"), cwd)
     if directory:
         self.shell.set_cwd(directory)
     self.redirect_stdio.emit(True)
开发者ID:Micseb,项目名称:spyder,代码行数:8,代码来源:pythonshell.py

示例4: select_directory

 def select_directory(self):
     """Select directory"""
     self.parent().redirect_stdio.emit(False)
     directory = getexistingdirectory(self, _("Select directory"),
                                      self.dir_combo.currentText())
     if directory:
         self.set_directory(directory)
     self.parent().redirect_stdio.emit(True)
开发者ID:AminJamalzadeh,项目名称:spyder,代码行数:8,代码来源:findinfiles.py

示例5: select_directory

 def select_directory(self):
     """Select directory"""
     self.emit(SIGNAL('redirect_stdio(bool)'), False)
     directory = getexistingdirectory(self.main, _("Select directory"),
                                      getcwd())
     if directory:
         self.chdir(directory)
     self.emit(SIGNAL('redirect_stdio(bool)'), True)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:8,代码来源:workingdirectory.py

示例6: select_directory

 def select_directory(self):
     """Select directory"""
     self.parent().emit(SIGNAL('redirect_stdio(bool)'), False)
     directory = getexistingdirectory(self, _("Select directory"),
                                      self.dir_combo.currentText())
     if directory:
         self.set_directory(directory)
     self.parent().emit(SIGNAL('redirect_stdio(bool)'), True)
开发者ID:jromang,项目名称:retina-old,代码行数:8,代码来源:findinfiles.py

示例7: select_directory

 def select_directory(self):
     """Select directory"""
     basedir = to_text_string(self.wd_edit.text())
     if not osp.isdir(basedir):
         basedir = getcwd()
     directory = getexistingdirectory(self, _("Select directory"), basedir)
     if directory:
         self.wd_edit.setText(directory)
         self.wd_cb.setChecked(True)
开发者ID:arvindchari88,项目名称:newGitTest,代码行数:9,代码来源:runconfig.py

示例8: select_directory

 def select_directory(self, edit):
     """Select directory"""
     basedir = to_text_string(edit.text())
     if not osp.isdir(basedir):
         basedir = getcwd()
     title = _("Select directory")
     directory = getexistingdirectory(self, title, basedir)
     if directory:
         edit.setText(directory)
开发者ID:gyenney,项目名称:Tools,代码行数:9,代码来源:configdialog.py

示例9: select_directory

 def select_directory(self, edit):
     """Select directory"""
     basedir = unicode(edit.text())
     if not osp.isdir(basedir):
         basedir = os.getcwdu()
     title = _("Select directory")
     directory = getexistingdirectory(self, title, basedir)
     if directory:
         edit.setText(directory)
开发者ID:jromang,项目名称:retina-old,代码行数:9,代码来源:configdialog.py

示例10: add_path

 def add_path(self):
     self.emit(SIGNAL('redirect_stdio(bool)'), False)
     directory = getexistingdirectory(self, _("Select directory"),
                                      self.last_path)
     self.emit(SIGNAL('redirect_stdio(bool)'), True)
     if directory:
         directory = osp.abspath(directory)
         self.last_path = directory
         if directory in self.pathlist:
             answer = QMessageBox.question(self, _("Add path"),
                 _("This directory is already included in Spyder path "
                         "list.<br>Do you want to move it to the top of "
                         "the list?"),
                 QMessageBox.Yes | QMessageBox.No)
             if answer == QMessageBox.Yes:
                 self.pathlist.remove(directory)
             else:
                 return
         self.pathlist.insert(0, directory)
         self.update_list()
开发者ID:jromang,项目名称:spyderlib,代码行数:20,代码来源:pathmanager.py


注:本文中的spyderlib.qt.compat.getexistingdirectory函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。