diff --git a/application.py b/application.py index 9de59ac..1e3d174 100755 --- a/application.py +++ b/application.py @@ -169,15 +169,15 @@ class Application(object): self.registers = {} # initialize tab handlers - completer.set('path', completer.FileCompleter(self)) - completer.set('buffer', completer.BufferCompleter(self)) - completer.set('command', completer.CommandCompleter(self)) - completer.set('shell', completer.ShellCompleter(self)) - completer.set('config', completer.ConfigCompleter(self)) - completer.set('method', completer.MethodCompleter(self)) - completer.set('register', completer.RegisterCompleter(self)) - completer.set('mode', completer.ModeCompleter(self)) - completer.set('token', completer.TokenCompleter(self)) + completer.set_completer('path', completer.FileCompleter(self)) + completer.set_completer('buffer', completer.BufferCompleter(self)) + completer.set_completer('command', completer.CommandCompleter(self)) + completer.set_completer('shell', completer.ShellCompleter(self)) + completer.set_completer('config', completer.ConfigCompleter(self)) + completer.set_completer('method', completer.MethodCompleter(self)) + completer.set_completer('register', completer.RegisterCompleter(self)) + completer.set_completer('mode', completer.ModeCompleter(self)) + completer.set_completer('token', completer.TokenCompleter(self)) # set up curses self.win = curses.newwin(self.y, self.x, 0, 0) @@ -273,7 +273,7 @@ class Application(object): self.complete_slot = None def set_completer(self, datatype, comp): - completer.set(datatype, comp) + completer.set_completer(datatype, comp) # this sets up a mode, as well as optionally adding information on when to # auto-load the mode diff --git a/completer.py b/completer.py index ce9ef3c..8541403 100644 --- a/completer.py +++ b/completer.py @@ -3,11 +3,11 @@ import method, util _completers = {} -def set(name, completer): +def set_completer(name, completer): global _completers _completers[name] = completer -def get(*args): +def get_completer(*args): return _completers.get(*args) def find_common_string(candidates): diff --git a/method/__init__.py b/method/__init__.py index dcb33bd..35044e0 100644 --- a/method/__init__.py +++ b/method/__init__.py @@ -52,7 +52,7 @@ class Argument(object): vargs2[self.name] = self.coerce_to_type(v) app.close_mini_buffer() method.execute(w, **vargs2) - tabber = completer.get(self.datatype) + tabber = completer.get_completer(self.datatype) if d is not None: p = self.prompt + "(%s) " % (d) else: diff --git a/mode/shellmini.py b/mode/shellmini.py index d8d3782..0898faa 100644 --- a/mode/shellmini.py +++ b/mode/shellmini.py @@ -85,9 +85,9 @@ class ShellTab(Method): s1 = curr_t.string if(curr_i == 0) and '/' not in s1: - completer = completer.get['command'] + completer = completer.get_completer['command'] else: - completer = completer.get['path'] + completer = completer.get_completer['path'] s2, exists, complete = completer.tab_string(s1, w) w.delete(Point(curr_t.x, curr_t.y), Point(curr_t.end_x(), curr_t.y))