def admin(): ''' Takes path from the route and tells Apache to server the file. @param path: The path to the file relative to root. @type path: str ''' return dict(user_data=Server.get_user_data(), site_data=Server.get_site_data())
def userdata(user=None): ''' Takes path from the route and tells Apache to server the file. @param path: The path to the file relative to root. @type path: str ''' confirm, user_data = Server.get_user_data(user) if confirm: ret = [] for key, val in user_data.iteritems(): for v in val: ret.append( { key : v }) ret.sort(cmp=time_sort) return dict(user = confirm, user_data = ret) else: ret = user_data.keys() return dict(user_data = ret)