Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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')
Exemplo n.º 3
0
    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')
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    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')
Exemplo n.º 6
0
 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'))
Exemplo n.º 7
0
    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')
Exemplo n.º 8
0
 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')
Exemplo n.º 9
0
    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')
        )
Exemplo n.º 10
0
    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)
Exemplo n.º 11
0
 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')
Exemplo n.º 12
0
    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)
Exemplo n.º 13
0
 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')
Exemplo n.º 14
0
    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)
Exemplo n.º 15
0
    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)
Exemplo n.º 16
0
    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)
Exemplo n.º 17
0
    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')
Exemplo n.º 18
0
    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')
Exemplo n.º 19
0
    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'))
Exemplo n.º 20
0
    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')
Exemplo n.º 21
0
	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)
Exemplo n.º 22
0
    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)
Exemplo n.º 23
0
 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)
Exemplo n.º 24
0
    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)
Exemplo n.º 25
0
    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')
Exemplo n.º 26
0
    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')
Exemplo n.º 27
0
    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')
Exemplo n.º 28
0
    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)
Exemplo n.º 29
0
 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)
Exemplo n.º 30
0
    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')
Exemplo n.º 31
0
    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')
Exemplo n.º 32
0
    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')
Exemplo n.º 33
0
    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')
Exemplo n.º 34
0
    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)
Exemplo n.º 35
0
 def GET(self):
     return render.layout(view.feedback(),
                          title='Feedback - Google Modules')
Exemplo n.º 36
0
 def new(self, module_id):
     if not modules.get_module(module_id):
         return render.layout('')
     else:
         return meth(self, module_id)
Exemplo n.º 37
0
    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')
Exemplo n.º 38
0
 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')
Exemplo n.º 39
0
 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')
Exemplo n.º 40
0
Arquivo: base.py Projeto: gcobos/rft
 def GET(self):
     return render.layout(view.help(functions.getCount()), title='FAQ - ' + projectName)
Exemplo n.º 41
0
 def GET(self):
     return render.layout(view.about(), title='About')
Exemplo n.º 42
0
	def __makepage(self, regform = None):
		if regform is None: regform = RegForm()
		return render.layout(view.signup(regform), title="Sign up")
Exemplo n.º 43
0
def notfound():
    return web.notfound(
        render.layout(view.not_found(),
                      title='File not found',
                      mode='error404'))
Exemplo n.º 44
0
 def new(self, functionName):
     if not functions.getFunctionIdByName(functionName):
         return render.layout('')
     else:
         return meth(self, functionName)
Exemplo n.º 45
0
 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')
Exemplo n.º 46
0
 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')
Exemplo n.º 47
0
 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')
Exemplo n.º 48
0
    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')
Exemplo n.º 49
0
	def __makepage(self, loginform = None):
		if loginform is None: loginform = LoginForm()
		return render.layout(view.signin(loginform), title="Sign in")
Exemplo n.º 50
0
 def GET(self):
     cloud = tags.get_author_cloud()
     return render.layout(view.tag_cloud_author(cloud), title='All Authors')
Exemplo n.º 51
0
Arquivo: base.py Projeto: gcobos/rft
 def GET(self):
     return render.layout(
         view.about(misc.getCredits()), title='About - ' + projectName)
Exemplo n.º 52
0
 def GET(self):
     return render.layout(view.submit_module(), 
         title='Submit - Google Modules')
Exemplo n.º 53
0
 def GET(self):
     cloud = tags.get_tag_cloud()
     return render.layout(view.tag_cloud(cloud), title='All Tags')
Exemplo n.º 54
0
 def GET(self):
     return render.layout(view.about(misc.get_credits()),
                          title='About - Google Modules')
Exemplo n.º 55
0
 def GET(self):
     return render.layout(view.sample(), title='Sample')
Exemplo n.º 56
0
def internalerror():
    return web.internalerror(
        render.layout(view.internal_error(),
                      title='Some error occured',
                      mode='modeShow404'))
Exemplo n.º 57
0
 def GET(self):
     return render.layout(view.submit_module(),
                          title='Submit - Google Modules')
Exemplo n.º 58
0
 def GET(self):
     return render.layout(view.help(modules.get_count()),
                          title='FAQ - Google Modules')