Example #1
0
 def POST(self):
     import json, httplib
     params = webpy.input()
     apiParam = {
         'username': params.get('username', ''),
         'userpwd': params.get('username', ''),
         'compName': params.get('username', ''),
         'compManager': params.get('username', ''),
         'compPhone': params.get('username', '')
     }
     conn = httplib.HTTPConnection()
     return 'posting'
Example #2
0
 def POST(self):
     import json, httplib
     params = webpy.input()
     apiParam = {
         'username': params.get('username', ''),
         'userpwd': params.get('username', ''),
         'compName': params.get('username', ''),
         'compManager': params.get('username', ''),
         'compPhone': params.get('username', '')
     }
     conn = httplib.HTTPConnection()
     return 'posting'
Example #3
0
 def GET(self):
     params = web.input()
     try:
         query = params.query
         #resultsAsDict = proxy.search(query)
         results = [{"sha":["123123123","12313213"], "name":["test"]},
                          {"sha":["00000000"], "name":["otroName"]}
                         ]
         #results = [Foaf(f) for f in resultsAsDict]
         #print "FIXME Draw with template in HTML %i results" %( len(results))
         try:
             render('results.html',{'results':results})
         except Exception, e:
             print str(e)
     except AttributeError:
         web.header("Content-Type","text/html; charset=utf-8")
         render('form.html')
Example #4
0
    def POST(self):
        x = web.input(myfile={})
        if not x.myfile.value:
            errmsg = "For some reason I can't read your file"
            return render.index(errmsg)

        try:
            data = reader.load_data(x.myfile.value)
        except ValueError:
            print >> sys.stderr, "Wrong file format from user"
            return render.index("Your file does not look like a JSON file.")

        # do the magic
        bookmark = reader.convert(data, False)

        # force browser to show "Save as" dialog.
        web.header('Content-Type', x.myfile.type) # file type
        web.header('Content-disposition',
                   'attachment; filename='+ x.myfile.filename + '.html') 
        model.Increment().increment_users()
        return reader.dump_data(bookmark) # your blob 
Example #5
0
 def POST(self):
     params = webpy.input()
     webpy.ctx.session.uid = params.get('username', False)
     webpy.ctx.session.group = params.get('group', False)
     raise webpy.seeother('admin/manage')
Example #6
0
 def __executApi(self, url, resType, method):
     params = webpy.input()
     datas = webpy.data()
     api_rst = self.usServer.executeApi(url, params=params, datas=datas, resType=resType, method=method)
     return api_rst
Example #7
0
 def POST(self):
     params = webpy.input()
     webpy.ctx.session.uid = params.get('username', False)
     webpy.ctx.session.group = params.get('group', False)
     raise webpy.seeother('admin/manage')