Anonymous avatar Anonymous committed f76ade7

Renamed history.pickle to history

Comments (0)

Files changed (2)


+import shutil
 import cPickle as pickle
 from rope.base import exceptions, change, taskhandle
         self.current_change = None
     def _load_history(self):
-        if self.history_file is not None and self.history_file.exists():
+        if self.history_file is not None:
+            if not self.history_file.exists():
+                self._import_old_files()
+            if not self.history_file.exists():
+                return
             input_file = self.opener(self.history_file.real_path)
             to_change = change.DataToChange(self.history_file.project)
             for data in pickle.load(input_file):
+    def _import_old_files(self):
+        old = self.project.get_file(self.project.ropefolder.path +
+                                    '/history.pickle')
+        if not self.history_file.exists() and \
+           old.exists() and not self.compress:
+            shutil.move(old.real_path, self.history_file.real_path)
     def _get_history_file(self):
         if self.project.get_prefs().get('save_history', False):
             folder = self.project.ropefolder
                 if self.compress:
                     return self.project.get_file(folder.path + '/history.gz')
-                    return self.project.get_file(folder.path +
-                                                 '/history.pickle')
+                    return self.project.get_file(folder.path + '/history')
     history_file = property(_get_history_file)


+import shutil
 import cPickle as pickle
-import UserDict
-import shutil
 from rope.base.oi import objectdb
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.