def dispatch(self, action): if action != '': if action == 'homepage': v = View() v.printHeader() v.getView(action) elif action == 'duck': api = APIConnector() query = cgi.FieldStorage() results = api.search(query.getvalue('keyword')) print results # v = View() # v.printHeader() # v.getView(action, results) else: print 'no action'
def dispatch(self, query=()): if "action" not in query: action = "home" else: action = query.getvalue("action") data = {"username": "******", "controller": "User"} v = View() v.print_header() v.get_view("header", data) if action == "home": v.get_view("user_home", data) else: v.get_view("user_home", data) v.get_view("footer", data)