Anonymous committed 16c30ba

lisputils: added runtask function

Comments (0)

Files changed (3)


             def undo(handle):
                 for changes in self.project.history.undo(task_handle=handle):
                     self._reload_buffers(changes, undo=True)
-            lisputils.RunTask(undo, 'Undo refactoring', interrupts=False)()
+            lisputils.runtask(undo, 'Undo refactoring', interrupts=False)
     def redo(self):
             def redo(handle):
                 for changes in self.project.history.redo(task_handle=handle):
-            lisputils.RunTask(redo, 'Redo refactoring', interrupts=False)()
+            lisputils.runtask(redo, 'Redo refactoring', interrupts=False)
     def _get_region(self):
         offset1 = self._get_offset()
                 return codeassist.find_occurrences(
                     self.project, resource, offset,
                     unsure=unsure, resources=resources, task_handle=handle)
-            result = lisputils.RunTask(calculate, 'Find Occurrences')()
+            result = lisputils.runtask(calculate, 'Find Occurrences')
             text = []
             for occurrence in result:
                 line = '%s : %s' % (occurrence.resource.path, occurrence.offset)
         def generate(handle):
             self.autoimport.generate_modules_cache(modules, task_handle=handle)
-        lisputils.RunTask(generate, 'Generate autoimport cache')()
+        lisputils.runtask(generate, 'Generate autoimport cache')
     def _insert_import(self, name, module):
         current = lisp.point()


         return calculate.result
+def runtask(command, name, interrupts=True):
+    return RunTask(command, name, interrupts)()
 def create_progress(name):
     if _emacs_version() < 22:
         progress = _OldProgress(name)


         def calculate(handle):
             return self._calculate_changes(result, handle)
         name = 'Calculating %s changes' %
-        changes = lisputils.RunTask(calculate, name=name)()
+        changes = lisputils.runtask(calculate, name=name)
         if action == 'perform':
         if action == 'preview':
   , task_handle=handle)
-        lisputils.RunTask(perform, 'Making %s changes' %,
-                          interrupts=False)()
+        lisputils.runtask(perform, 'Making %s changes' %,
+                          interrupts=False)
         lisputils.message(str(changes.description) + ' finished')
     def _get_confs(self):
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.