diff --git a/application.py b/application.py index 4b766a7..e94a469 100755 --- a/application.py +++ b/application.py @@ -239,6 +239,17 @@ class Application(object): curses.noecho() curses.nonl() + def setmode(self, name, cls, paths=[], basenames=[], extensions=[], detection=[]): + self.modes[name] = cls + for p in paths: + self.mode_paths[p] = name + for b in basenames: + self.mode_basenames[b] = name + for e in extensions: + self.mode_extensions[e] = name + for d in detection: + self.mode_detection[d] = name + def globals(self): return globals() def locals(self):