| 3807 | self.append(self.itemContainer, key='items') # replace the old widget |
| 3808 | |
| 3809 | def dir_go_back(self, widget): |
| 3810 | curpath = os.getcwd() # backup the path |
| 3811 | try: |
| 3812 | os.chdir(self.pathEditor.get_text()) |
| 3813 | os.chdir('..') |
| 3814 | self.chdir(os.getcwd()) |
| 3815 | except Exception as e: |
| 3816 | self.pathEditor.set_text(self._last_valid_path) |
| 3817 | log.error('error changing directory', exc_info=True) |
| 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 |