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 sitedata(url=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 ''' if url: url = url.replace('__slashslash__', '//') logging.debug("URL Recieved: %s", url) confirm, site_data = Server.get_site_data(url) logging.debug("confirm: %s,site_data: %s", confirm, site_data) if confirm: ret = site_data ret.sort(cmp=url_time_sort) return dict(url=confirm, site_data = ret) else: ret = [] for key, val in site_data.iteritems(): ret.append( { key : len(val) }) ret.sort(cmp=value_sort) return dict(site_data = ret)