def post(self, **params): module = self.get_argument('module', 'missing') if module == 'missing': self.clear() self.set_status(404) self.finish("<html><body>Missing function call</body></html>") return else: Log.Debug('Recieved a post call for module: ' + module) if module == 'logs': self = logs().reqprocessPost(self) elif module == 'settings': self = settings().reqprocessPost(self) elif module == 'pms': self = pms().reqprocessPost(self) elif module == 'findUnmatched': self = findUnmatched().reqprocessPost(self) else: self.clear() self.set_status(412) self.finish("<html><body>Unknown module call</body></html>") return
def get(self, **params): module = self.get_argument('module', 'missing') if module == 'missing': self.clear() self.set_status(404) self.finish("<html><body>Missing function call</body></html>") return else: Log.Debug('Recieved a get call for module: ' + module) #TODO ''' import sys sys.path.append(os.path.join(Core.app_support_path, 'Plug-ins', NAME + '.bundle', 'Contents', 'Code')) mod = import_module(module) modClass = getattr(mod, module)() print 'GED1', dir(modClass) callFunction = getattr(modClass, 'reqprocess') self = modClass().reqprocess(self) ''' if module == 'git': self = git().reqprocess(self) elif module == 'logs': self = logs().reqprocess(self) elif module == 'pms': self = pms().reqprocess(self) elif module == 'settings': self = settings().reqprocess(self) elif module == 'findUnmatched': self = findUnmatched().reqprocess(self) else: self.clear() self.set_status(412) self.finish("<html><body>Unknown module call</body></html>") return