def POST(self): i = web.input() success = send_feedback(i.author_email, i.subject, i.comment) return render.layout( view.submitted_form(success, type='feedback'), title='Feedback - '+ projectName)
def POST(self): i = web.input(url='', tags='', _unicode=False) success, err_msg = submission.submit(i.url, i.tags) rss.update_rss() return render.layout(view.submitted_form(success, type='submit', err_msg=err_msg), title='Submit - Google Modules')
def POST(self, thread_id): i = web.input(reply_to='', author='', content='') success = threads.reply(i) return render.layout(view.submitted_form(success), title='Saving Post - Google Modules', mode='modeForum')
def GET(self, tag): tag = utils.url_unquote(tag) listed = modules.filter_by_tag(tag) sub_title = 'Tag: %s' % tag return render.layout(view.list_modules(listed, sub_title=sub_title), title='%s - Google Modules' % sub_title)
def GET(self, order_by='title', page_number='1'): if not order_by: order_by = '' page_number = web.intget(page_number, 0) m, has_next = modules.get_all_modules(order_by, offset=page_number * 50) next_page_url = '' if has_next: if not order_by: next_page_url = '/modules/%s/' % (page_number + 1) else: next_page_url = '/modules/by-%s/%s/' % (order_by, page_number + 1) sub_title = 'Page %s' % (page_number + 1) return render.layout(view.all_modules(m, modules.get_count(), order_by, next_page_url, sub_title=sub_title), title='All modules - %s - Google Modules' % sub_title, mode='modeAllModules')
def GET(self): if web.input().has_key('q'): return web.seeother('/search/?' + utils.url_encode(web.input())) latest_modules, has_next = modules.get_latest() return render.layout( view.list_modules(latest_modules, next_page_url='/page/1/', sub_title='Latest Modules'))
def GET(self, thread_id): thread = threads.get_thread(thread_id) conversation = threads.get_conversation(thread_id) return render.layout(view.show_thread(thread, conversation), title=thread.title + ' - Forum - Google Modules', mode='modeForum')
def GET(self, author_name): author_name = urllib.unquote_plus(author_name) all_modules = modules.get_from_author(author_name) latest_comments = comments.get_latest_for_author(author_name) return render.layout( view.list_modules_by_author(all_modules, latest_comments, author_name), title='Modules by %s - Google Modules' % author_name, mode='modeViewAuthor')
def GET (self, page = 0): #if web.input().has_key('q'): # return web.seeother('/search/?' + utils.url_encode(web.input())) latest_functions, has_next = functions.getLatest(offset=page * listLimit) return render.layout( view.list_functions(latest_functions, has_next, sub_title='Latest Functions') )
def GET(self, tag): tag = utils.url_unquote(tag) listed = modules.filter_by_tag(tag) sub_title = 'Tag: %s' % tag return render.layout( view.list_modules(listed, sub_title=sub_title), title = '%s - Google Modules' % sub_title)
def GET(self, module_id): module = modules.get_module(module_id) _tags = tags.get_tags(module_id) _comments = comments.get_comments(module_id) related_module = modules.get_related(module_id) return render.layout(view.show_module(module, _tags, _comments, related_module, misc.get_pub_id()), title=module.title + ' - Google Modules')
def GET (self, functionName): functionId = functions.getFunctionIdByName(functionName) function = functions.getFunction(functionId) print function categories = functions.getCategories() return render.layout(view.submit_function(function, categories, action='update'), title='Edit function - ' + projectName)
def GET(self): latest_posts, has_next = threads.get_latest() return render.layout(view.list_threads( latest_posts, next_page_url='page/1/', sub_title='Share your thoughts'), title='Discuss - Google Modules', mode='modeForum')
def GET (self, functionName): functionId = functions.getFunctionIdByName(functionName) function = functions.getFunction(functionId) del(function.category) (primitivesStr, bestNode, minError, numNodes, err_msg) = functions.train(function) return render.layout(view.train_function(function, primitivesStr, bestNode, minError, numNodes, err_msg ), title='Training '+functionName+' - ' + projectName)
def GET (self, functionName): functionId = functions.getFunctionIdByName(functionName) function = functions.getFunction(functionId) del(function.category) values = [] (source, numNodes, totalError, err_msg) = functions.test(function, values) return render.layout(view.test_function(function, source, numNodes, totalError, err_msg ), title='Testing '+functionName+' - ' + projectName)
def GET (self, functionId=0): categories = functions.getCategories() if functionId: function = functions.getFunction(FunctionId) else : function = functions.createNew() return render.layout(view.submit_function(function, categories, action='submit'), title='Submit function - ' + projectName)
def POST(self, module_id): i = web.input(comment='', author='') success, err_msg = comments.add(module_id, i.author, i.comment) return render.layout(view.submitted_form(success, module_id, 'comment', err_msg=err_msg), title='Submit Comment - Google Modules')
def GET(self): scripts = ['scripts/ace/ace.js', 'scripts/ace/mode-csharp.js', 'scripts/ace/mode-java.js', 'scripts/ace/mode-c_cpp.js', 'scripts/compiler.js', 'scripts/jquery.easing.1.3.js', 'scripts/jqueryFileTree.js'] styles = ['css/jqueryFileTree.css',] return render.layout(view.index(issigned=session.is_signed()), title='Home', scripts=scripts, styles=styles)
def POST (self): data = web.input( isPrimitive='0', isCorrect='0', isCommutative='0', isRecursive='0', _unicode=False) function = functions.bind(data) print "Lalal"+ str(function) (success, err_msg) = functions.checkData(function) if success: success, err_msg = functions.add(function) #rss.update_rss() return render.layout(view.submitted_form(success, type='submit', err_msg=err_msg), title='Submit function - ' + projectName)
def GET(self): scripts = [ 'scripts/ace/ace.js', 'scripts/ace/mode-csharp.js', 'scripts/ace/mode-java.js', 'scripts/ace/mode-c_cpp.js', 'scripts/compiler.js', 'scripts/jquery.easing.1.3.js', 'scripts/jqueryFileTree.js' ] styles = [ 'css/jqueryFileTree.css', ] return render.layout(view.index(issigned=session.is_signed()), title='Home', scripts=scripts, styles=styles)
def POST (self): function = web.input( isPrimitive='0', isCorrect='0', isCommutative='0', isRecursive='0', _unicode=False) (success, err_msg) = functions.checkData(function,True) if success: #print "Updating2 "+ str(function) success, err_msg = functions.update(function) if success: web.seeother('/show/'+function.name) return render.layout(view.submitted_form(success, type='submit', err_msg=err_msg), title='Submit function - ' + projectName)
def GET(self, page_number): page_number = int(page_number) latest_modules, has_next = modules.get_latest(offset=page_number*10) next_page_url = '' if has_next: next_page_url = '/page/%s/' % (page_number + 1) sub_title = 'Latest Modules' if page_number: sub_title += ' - Page %s' % (page_number + 1) return render.layout( view.list_modules(latest_modules, next_page_url=next_page_url, sub_title=sub_title), title = page_number and 'Page %s - Google Modules' % (page_number + 1) or 'Google Modules')
def GET(self, page_number): page_number = int(page_number) latest_functions, has_next = functions.getFromCategory(categoryId=0 ,offset=page_number * listLimit ) next_page_url = '' if has_next: next_page_url = '/page/%s/' % (page_number + 1) sub_title = 'Latest functions' if page_number: sub_title += ' - Page %s' % (page_number + 1) return render.layout( view.list_functions(latest_functions, next_page_url=next_page_url, sub_title=sub_title), title = page_number and 'Page %s - Functions' % (page_number + 1) or 'Functions')
def GET(self, page_number): page_number = int(page_number) latest_posts, has_next = threads.get_latest(offset=page_number*20) next_page_url = '' if has_next: next_page_url = 'page/%s/' % (page_number + 1) sub_title = 'Share your thoughts' if page_number: sub_title += ' - Page %s' % (page_number + 1) return render.layout( view.list_threads(latest_posts, next_page_url=next_page_url, sub_title=sub_title), title = 'Discuss - Google Modules', mode = 'modeForum')
def GET(self, functionName): functionId = functions.getFunctionIdByName(functionName) function = functions.getFunction(functionId) #print "La function ",function related_functions = functions.getRelated(functionId) """ source=function.source.split("\n") print("Source",source) if len(source): if ':' in source[0]: source, error = source[0].split(':') function.source=source """ return render.layout(view.show_function(function, related_functions, misc.get_pub_id()), title=function.name + ' - ' + projectName)
def GET(self): i = web.input(q='', page_number=0) page_number = int(i.page_number) searched, has_next = modules.search(i.q, offset=page_number*10) next_page_url = '' if has_next: next_page_url = '/search?q=%s&page_number=%s' % (i.q, page_number + 1) sub_title = 'You searched for: %s' % i.q if page_number: sub_title += ' - Page %s' % (page_number + 1) return render.layout( view.list_modules(searched, next_page_url=next_page_url, sub_title=sub_title), title = '%s - Google Modules' % sub_title, query = i.q)
def GET(self, page_number): page_number = int(page_number) latest_posts, has_next = threads.get_latest(offset=page_number * 20) next_page_url = '' if has_next: next_page_url = 'page/%s/' % (page_number + 1) sub_title = 'Share your thoughts' if page_number: sub_title += ' - Page %s' % (page_number + 1) return render.layout(view.list_threads(latest_posts, next_page_url=next_page_url, sub_title=sub_title), title='Discuss - Google Modules', mode='modeForum')
def GET(self, page_number): page_number = int(page_number) latest_modules, has_next = modules.get_latest(offset=page_number * 10) next_page_url = '' if has_next: next_page_url = '/page/%s/' % (page_number + 1) sub_title = 'Latest Modules' if page_number: sub_title += ' - Page %s' % (page_number + 1) return render.layout(view.list_modules(latest_modules, next_page_url=next_page_url, sub_title=sub_title), title=page_number and 'Page %s - Google Modules' % (page_number + 1) or 'Google Modules')
def GET(self, order_by='title', page_number='1'): if not order_by: order_by = '' page_number = web.intget(page_number, 0) m, has_next = modules.get_all_modules(order_by, offset=page_number*50) next_page_url = '' if has_next: if not order_by: next_page_url = '/modules/%s/' % (page_number + 1) else: next_page_url = '/modules/by-%s/%s/' % (order_by, page_number + 1) sub_title = 'Page %s' % (page_number + 1) return render.layout( view.all_modules(m, modules.get_count(), order_by, next_page_url, sub_title=sub_title), title = 'All modules - %s - Google Modules' % sub_title, mode = 'modeAllModules')
def GET(self, order_by='name', page_number= 0): if not order_by: order_by = '' page_number = web.intget(page_number, 0) m, has_next = functions.getAllFunctions(order_by, limit=config.listLimit,offset=page_number*config.listLimit) next_page_url = '' if has_next: if not order_by: next_page_url = '/list/page/%s/' % (page_number + 1) else: next_page_url = '/list/by-%s/%s/' % (order_by, page_number + 1) sub_title = 'Page %s' % (page_number + 1) return render.layout( view.all_functions(m, functions.getCount(), order_by, next_page_url, sub_title=sub_title), title = ('All functions - %s - '+projectName) % sub_title, mode = 'modeAllModules')
def GET(self): i = web.input(q='', page_number=0) page_number = int(i.page_number) searched, has_next = modules.search(i.q, offset=page_number * 10) next_page_url = '' if has_next: next_page_url = '/search?q=%s&page_number=%s' % (i.q, page_number + 1) sub_title = 'You searched for: %s' % i.q if page_number: sub_title += ' - Page %s' % (page_number + 1) return render.layout(view.list_modules(searched, next_page_url=next_page_url, sub_title=sub_title), title='%s - Google Modules' % sub_title, query=i.q)
def GET(self): return render.layout(view.feedback(), title='Feedback - Google Modules')
def new(self, module_id): if not modules.get_module(module_id): return render.layout('') else: return meth(self, module_id)
def POST(self, module_id): i = web.input(vote='').vote success = votes.add(module_id, web.intget(i, 0), utils.get_user_ip()) return render.layout(view.submitted_form(success, module_id, 'vote'), title='Submit Vote - Google Modules')
def GET(self): latest_posts, has_next = threads.get_latest() return render.layout( view.list_threads(latest_posts, next_page_url='page/1/', sub_title='Share your thoughts'), title = 'Discuss - Google Modules', mode = 'modeForum')
def GET(self, thread_id): thread = threads.get_thread(thread_id) conversation = threads.get_conversation(thread_id) return render.layout(view.show_thread(thread, conversation), title=thread.title + ' - Forum - Google Modules', mode = 'modeForum')
def GET(self): return render.layout(view.help(functions.getCount()), title='FAQ - ' + projectName)
def GET(self): return render.layout(view.about(), title='About')
def __makepage(self, regform = None): if regform is None: regform = RegForm() return render.layout(view.signup(regform), title="Sign up")
def notfound(): return web.notfound( render.layout(view.not_found(), title='File not found', mode='error404'))
def new(self, functionName): if not functions.getFunctionIdByName(functionName): return render.layout('') else: return meth(self, functionName)
def POST(self, thread_id): i = web.input(reply_to='', author='', content='') success = threads.reply(i) return render.layout(view.submitted_form(success), title='Saving Post - Google Modules', mode = 'modeForum')
def POST(self): i = web.input() success = send_feedback(i.author_email, i.subject, i.comment) return render.layout(view.submitted_form(success, type='feedback'), title='Feedback - Google Modules')
def __makepage(self, loginform = None): if loginform is None: loginform = LoginForm() return render.layout(view.signin(loginform), title="Sign in")
def GET(self): cloud = tags.get_author_cloud() return render.layout(view.tag_cloud_author(cloud), title='All Authors')
def GET(self): return render.layout( view.about(misc.getCredits()), title='About - ' + projectName)
def GET(self): return render.layout(view.submit_module(), title='Submit - Google Modules')
def GET(self): cloud = tags.get_tag_cloud() return render.layout(view.tag_cloud(cloud), title='All Tags')
def GET(self): return render.layout(view.about(misc.get_credits()), title='About - Google Modules')
def GET(self): return render.layout(view.sample(), title='Sample')
def internalerror(): return web.internalerror( render.layout(view.internal_error(), title='Some error occured', mode='modeShow404'))
def GET(self): return render.layout(view.help(modules.get_count()), title='FAQ - Google Modules')