| 3818 | os.chdir(curpath) # restore the path |
| 3819 | |
| 3820 | def dir_go(self, widget): |
| 3821 | # when the GO button is pressed, it is supposed that the pathEditor is changed |
| 3822 | curpath = os.getcwd() # backup the path |
| 3823 | try: |
| 3824 | os.chdir(self.pathEditor.get_text()) |
| 3825 | self.chdir(os.getcwd()) |
| 3826 | except Exception as e: |
| 3827 | log.error('error going to directory', exc_info=True) |
| 3828 | self.pathEditor.set_text(self._last_valid_path) |
| 3829 | os.chdir(curpath) # restore the path |
| 3830 | |
| 3831 | def chdir(self, directory): |
| 3832 | self._selection_folder = directory |