本文整理汇总了Python中view.render.base函数的典型用法代码示例。如果您正苦于以下问题:Python base函数的具体用法?Python base怎么用?Python base使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了base函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: GET
def GET(self):
i = web.input(uid=None, sha=None, full=0)
if i.uid == None:
return render.base(view.listing())
else:
results = config.DB.select('items', dict(n=str(i.uid)), where="id=$n")
rows = results.list()
print ("Row count: " + str(len(rows)))
if len(rows) > 0:
row = rows[0]
results = config.DB.query("SELECT * FROM scores WHERE id='" + str(i.uid) + "'")
if i.full == 0:
for r in results.list():
print ("Updating: " + r['commitsha'])
outdir = os.getcwd() + '/static/' + r['commitsha'] + '/'
score, pagecount, all_scores = document_compare.compare_pdf_using_images(row['id'], outdir)
config.DB.update('scores', where='id="' + str(i.uid) + '" AND commitsha="' + str(r['commitsha']) + '"', olscore=score[0],ollscore=score[1], olwscore=score[2], details=str(all_scores).strip('[]'))
else:
shutil.copy(os.getcwd() + '/static/originals/' + str(i.uid) + row['extension'], '/tmp/')
if results[0].total_version == len(lo):
config.DB.delete('scores', where='id = "' + str(i.uid) + '"')
a = threading.Thread(target=worker, args=('/tmp/' + str(i.uid) + row['extension'], False, ))
a.start()
else:
a = threading.Thread(target=worker, args=('/tmp/' + str(i.uid) + row['extension'], True, ))
a.start()
return render.base(view.listing())
开发者ID:peppsac,项目名称:doccmp,代码行数:30,代码来源:code.py
示例2: GET
def GET(self, cart_id):
"""Display the badges associated with a Cart ID"""
try:
bson.objectid.ObjectId(cart_id)
except bson.errors.InvalidId:
return render.base(render.validate(None, ("bad", "Invalid ObjectId")), "Pickup", True)
return render.base(render.pickup(view.badgeListing(cart_id)), "Pickup", True)
开发者ID:elwillow,项目名称:kaiinshou,代码行数:8,代码来源:auth.py
示例3: POST
def POST(self):
x = web.input(querytag='')
gm=Global_Mod()
gm.tag=x.querytag
gm.results=Search.searchbytag(gm.tag)
gm.results=[item.replace('\\','/') for item in gm.results]
print gm.results
if gm.results==[]:
return render.base(view.noresult())
else:
return render.base(view.tagresult(gm.tag,gm.results))
开发者ID:saucewan,项目名称:imageSearch,代码行数:11,代码来源:searchbytag.py
示例4: GET
def GET(self, source, feed_type=None):
if not feed_type:
events = db.get_events(order='time_start, name',
where="not cancelled and time_start >= date_sub(current_timestamp, interval 5 hour) and taken_from= '%s'" % (source))
web.debug(len(events))
#add source specific feed
print render.base(render.show_events( events, admin=False), feeds=["""
<link rel="alternate"
type="application/atom+xml" title="%s calendar - Atom"
href="http://%s/from/%s/feed.atom" />
""" % (source, config.server_root_url, source),])
else:
events = [e for e in db.get_events(limit='100', order='time_taken desc', where ="taken_from= '%s'" % (source))]
render_cached_feed(events, feed_type)
开发者ID:antoine,项目名称:metagenda,代码行数:14,代码来源:main.py
示例5: GET
def GET (self):
#return render.base("Contact Us", "Contáctenos")
#print web.ctx.path
#return render.base(menu(), render.contact("Contáctenos"), "Contáctenos")
#return render.base(menu, web.ctx.path, render.contact("Contáctenos"), "Contáctenos")
return render.base(menu, web.ctx.path, render.contact(view.listCountries()))
开发者ID:jolth,项目名称:websiteDevMicrosystem,代码行数:7,代码来源:code.py
示例6: GET
def GET(self):
cart_id = web.cookies().get(config.cookieName)
if cart_id:
f = badgeForm()
return render.base(render.badge(f), "Nouvel insigne ~ New badge", True)
else:
raise web.seeother(config.make_url('/error'))
开发者ID:elwillow,项目名称:kaiinshou,代码行数:7,代码来源:badge.py
示例7: GET
def GET(self):
imglist=[]
ext=['png','bmp']
for file in os.listdir('static'):
if file.split('.')[-1] in ext:
imglist.append('static/'+file)
return render.base(view.allimg(imglist))
开发者ID:saucewan,项目名称:imageSearch,代码行数:7,代码来源:allimg.py
示例8: GET
def GET(self):
query_data = web.input(contact='', req_id='')
print query_data.contact
print query_data.req_id
confirm.notify_confirmation(query_data.contact, str(query_data.req_id))
return render.base(render.doconfirm(query_data.contact, query_data.req_id), 'SearchParty')
开发者ID:tacitia,项目名称:crowdSaliency,代码行数:7,代码来源:code.py
示例9: GET
def GET(self):
"""Display the cart listing"""
cart_id = web.cookies().get(config.cookieName)
if not cart_id:
cart_number = view.generateCartNumber()
cart_id = db.newCart(cart_number)
view.saveCookie(cart_id)
return render.base(view.cartListing(cart_id))
开发者ID:elwillow,项目名称:kaiinshou,代码行数:8,代码来源:code.py
示例10: GET
def GET(self, action, badge_id):
cart_id = view.getCookie()
if not cart_id:
raise web.seeother(config.make_url("/"))
elif "status" in db.getCart(cart_id):
view.destroyCookie()
raise web.seeother(config.make_url("/"))
return render.base(view.cartListing(cart_id, (action, badge_id)))
开发者ID:elwillow,项目名称:kaiinshou,代码行数:9,代码来源:app.py
示例11: POST
def POST(self):
x = web.input(myfile={})
print x['myfile'].filename
gm=Global_Mod()
gm.img = cv2.imdecode(numpy.fromstring(x['myfile'].file.read(), numpy.uint8), cv2.IMREAD_UNCHANGED)
resultslist=Search.search(gm.img)
for row in resultslist:
temp=list(row)
gm.results.append(temp[1].replace('\\','/'))
print gm.results
return render.base(view.imgresult(gm.img,gm.results))
开发者ID:saucewan,项目名称:imageSearch,代码行数:12,代码来源:upload.py
示例12: GET
def GET(self,page=1):
page = int(page)
limit=config.perpage
offset = (page -1)*limit
counting = db.counting()
pages = counting / limit
if counting % limit > 0:
pages += 1
if page > pages:
raise web.seeother('/')
else:
return render.base(view.listing(offset=offset,limit=limit),
pages=pages, curpage=page)
开发者ID:1060460048,项目名称:Scrapy-Examples,代码行数:13,代码来源:code.py
示例13: GET
def GET(self):
fill_seedwords()
category = None
category_list = {}
user_data = web.input()
if user_data.has_key('category'):
category = user_data.get('category')
k = {}
k['what'] = 'rank, name'
k['where'] = 'category = "%s"' % category
entities = db.listing(**k)
category_list['category'] = category
category_list['words'] = seedwords[category]
return render.base(view.listing(), category_list = category_list)
开发者ID:meister4ever,项目名称:word-clustering,代码行数:14,代码来源:code.py
示例14: GET
def GET(self):
x=web.input()
imgpath=x.imgpath
taglist=[]
print imgpath
with open('tag.csv') as f:
reader=csv.reader(f)
for row in reader:
temppath=row[0].replace('\\','/')
print temppath
if imgpath==temppath:
taglist=row[1:]
break
f.close()
return render.base(view.addtag(imgpath,taglist))
开发者ID:saucewan,项目名称:imageSearch,代码行数:15,代码来源:addtag.py
示例15: GET
def GET(self):
redact = {}
schema = db.wikischema()
block_list = db.get_redact_list()
for tcol in block_list:
redaction = db.get_redaction(tcol)
table, col = tcol.split('.')
if table not in redact:
redact[table] = {}
redact[table][col] = {}
redact[table][col]['type'] = schema[table][col]
redact[table][col]['redaction'] = redaction
m = re.search('\d+', schema[table][col])
if m and m.group(0):
redact[table][col]['size'] = m.group(0)
else:
redact[table][col]['size'] = 64
print redact
return render.base(view.menu('redacted'), view.redacted(redact))
开发者ID:preillyme,项目名称:operations-software-redactatron,代码行数:22,代码来源:code.py
示例16: POST
def POST(self):
cart_id = web.cookies().get(config.cookieName)
if cart_id:
# We have a cart, proceed
f = badgeForm()
if not f.validates():
return render.base(render.badge(f), "Nouvel insigne ~ New badge", True)
else:
# Everything is valid, let's build the query
badge = {
"prenom": f.d.prenom,
"nom": f.d.nom,
"texte_insigne": f.d.texte_insigne,
"courriel": f.d.courriel,
"adresse": {
"ligne_1": f.d.adresse_1,
"ligne_2": f.d.adresse_2,
"ville": f.d.ville,
"province": f.d.province,
"code_postal": f.d.code_postal
},
"type": f.d.type,
"telephone_urgence": f.d.telephone_urgence,
"extra": {
"noiz": f.d.noiz,
"tshirt": f.d.tshirt,
"dvd": f.d.dvd
},
"instructions_speciales": f.d.instructions_speciales,
"status": "IN_CART",
"date": datetime.datetime.utcnow()}
# Adding to DB
badge_id = db.addBadge(badge, cart_id)
raise web.seeother(config.make_url("/cart/add/%s" % badge_id))
else:
raise web.seeother(config.make_url('/error'))
开发者ID:elwillow,项目名称:kaiinshou,代码行数:38,代码来源:badge.py
示例17: POST
def POST(self):
form = web.input(doc={})
basename = form['doc'].filename.replace(' ', '_')
tempfile = '/tmp/' + basename
with open(tempfile, 'wb') as saved:
shutil.copyfileobj(form['doc'].file, saved)
uid = document_compare.compute_uid (tempfile)
# Remove old entries
config.DB.delete('scores', where='id = "' + uid + '"')
config.DB.delete('items', where='id = "' + uid + '"')
b, ext = os.path.splitext(form['doc'].filename)
# Insert
config.DB.insert('items', id=uid, name=b, pagecount=-1, extension=ext)
# Start bg thread
a = threading.Thread(target=worker, args=(tempfile, False, ))
a.start()
return render.base(view.listing())
开发者ID:peppsac,项目名称:doccmp,代码行数:23,代码来源:code.py
示例18: GET
def GET(self):
return render.base('hello world')
开发者ID:mapmeld,项目名称:skycache,代码行数:2,代码来源:skycache.py
示例19: GET
def GET(self):
return render.base(view.checkurl())
开发者ID:bekacho,项目名称:urldammit,代码行数:2,代码来源:urldammit.py
示例20: GET
def GET(self):
return render.base(view.listing())
开发者ID:ponych,项目名称:ponych_python,代码行数:2,代码来源:code.py
注:本文中的view.render.base函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论