本文整理汇总了Python中exe.webui.common.requestHasCancel函数的典型用法代码示例。如果您正苦于以下问题:Python requestHasCancel函数的具体用法?Python requestHasCancel怎么用?Python requestHasCancel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requestHasCancel函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: process
def process(self, request):
"""
Process the request arguments from the web server
"""
Block.process(self, request)
is_cancel = common.requestHasCancel(request)
self.storyElement.process(request)
if (u"addQuestion"+unicode(self.id)) in request.args:
self.idevice.addQuestion()
self.idevice.edit = True
# disable Undo once another activity has been added:
self.idevice.undo = False
if "title"+self.id in request.args \
and not is_cancel:
self.idevice.title = request.args["title"+self.id][0]
if "action" in request.args and request.args[u"action"][0] != u"delete":
for element in self.questionElements:
element.process(request)
if request.args[u"action"][0] == u'done':
# remove the undo flag in order to reenable it next time:
if hasattr(self.idevice,'undo'):
del self.idevice.undo
开发者ID:Rafav,项目名称:iteexe,代码行数:28,代码来源:ejercicioresueltofpdblock.py
示例2: process
def process(self, request):
"""
Process the request arguments from the web server to see if any
apply to this block
"""
is_cancel = common.requestHasCancel(request)
if is_cancel:
self.idevice.edit = False
# but double-check for first-edits, and ensure proper attributes:
if not hasattr(self.idevice.content, 'content_w_resourcePaths'):
self.idevice.content.content_w_resourcePaths = ""
if not hasattr(self.idevice.content, 'content_wo_resourcePaths'):
self.idevice.content.content_wo_resourcePaths = ""
return
Block.process(self, request)
if "title" + self.id in request.args and not is_cancel:
self.idevice.title = request.args["title" + self.id][0]
if (u"action" not in request.args or
request.args[u"action"][0] != u"delete"):
content = self.contentElement.process(request)
if content:
self.idevice.content = content
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:25,代码来源:hintblock.py
示例3: process
def process(self, request):
"""
Process the request arguments from the web server
"""
is_cancel = common.requestHasCancel(request)
Block.process(self, request)
if (u"action" not in request.args or
request.args[u"action"][0] != u"delete"):
for element in self.elements:
element.process(request)
if "title"+self.id in request.args \
and not is_cancel:
self.idevice.title = request.args["title"+self.id][0]
if "iconiDevice"+self.id in request.args \
and not is_cancel:
self.idevice.icon = request.args["iconiDevice"+self.id][0]
if not is_cancel:
if self.idevice.title !='' or self.idevice.icon !='':
self.idevice.emphasis = Idevice.SomeEmphasis
else:
self.idevice.emphasis = Idevice.NoEmphasis
开发者ID:exelearning,项目名称:iteexe,代码行数:25,代码来源:jsblock.py
示例4: process
def process(self, request):
"""
Process the request arguments from the web server
"""
Block.process(self, request)
is_cancel = common.requestHasCancel(request)
if ("addQuestion"+self.id) in request.args:
self.idevice.addQuestion()
self.idevice.edit = True
# disable Undo once a question has been added:
self.idevice.undo = False
for element in self.questionElements:
element.process(request)
if "title"+self.id in request.args \
and not is_cancel:
self.idevice.title = request.args["title"+self.id][0]
if ("action" in request.args and request.args["action"][0] == "done"
or not self.idevice.edit):
# remove the undo flag in order to reenable it next time:
if hasattr(self.idevice,'undo'):
del self.idevice.undo
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:26,代码来源:multiselectblock.py
示例5: process
def process(self, request):
"""
Handles a post from the webui and changes our state accordingly
"""
log.debug("process " + repr(request.args))
# If the commit is not to do with us forget it
is_cancel = common.requestHasCancel(request)
obj = request.args.get('object', [''])[0]
if "title"+self.id in request.args \
and not is_cancel:
self.idevice.title = request.args["title"+self.id][0]
if obj != self.id:
self.idevice.recreateResources()
self.processCaptions(request)
if obj != self.id:
Block.process(self, request)
return
# Separate out the action we want to do and the params
action = request.args.get('action', [''])[0]
if action.startswith('gallery.'):
self.processGallery(action)
if self.mode == Block.Edit \
and not is_cancel:
self.processCaptions(request)
if action == 'done':
self.idevice.recreateResources()
# remove the undo flag in order to reenable it next time:
if hasattr(self.idevice,'undo'):
del self.idevice.undo
# Let our ancestor deal with the rest
Block.process(self, request)
开发者ID:erral,项目名称:iteexe,代码行数:35,代码来源:galleryblock.py
示例6: process
def process(self, request):
"""
Process the request arguments from the web server
"""
is_cancel = common.requestHasCancel(request)
Block.process(self, request)
if "pages" + self.id in request.args and not is_cancel :
self.idevice.pages = request.args["pages" + self.id][0]
if "path" + self.id in request.args \
and not is_cancel:
pdfPath = request.args["path"+self.id][0]
self.idevice.path = pdfPath
try:
self.idevice.uploadFile()
except IOError, e:
log.error("Unable to add file %s" % pdfPath)
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:17,代码来源:pdfblock.py
示例7: process
def process(self, request):
"""
Process the request arguments from the web server to see if any
apply to this block
"""
log.debug("process " + repr(request.args))
is_cancel = common.requestHasCancel(request)
if 'emphasis'+self.id in request.args \
and not is_cancel:
self.idevice.emphasis = int(request.args['emphasis'+self.id][0])
# disable Undo once an emphasis has changed:
self.idevice.undo = False
if 'ssite'+self.id in request.args \
and not is_cancel:
self.idevice.site = request.args['ssite'+self.id][0]
if 'ownUrl'+self.id in request.args \
and not is_cancel:
self.idevice.ownUrl = request.args['ownUrl'+self.id][0]
if 'title'+self.id in request.args \
and not is_cancel:
self.idevice.title = request.args['title'+self.id][0]
if ("object" in request.args and request.args["object"][0] == "site" + self.id):
pass
elif 'loadWikipedia'+self.id in request.args:
# If they've hit "load" instead of "the tick"
self.idevice.loadArticle(request.args['article'][0])
# disable Undo once an article has been loaded:
self.idevice.undo = False
else:
# If they hit "the tick" instead of "load"
Block.process(self, request)
if (u"action" not in request.args \
or request.args[u"action"][0] != u"delete"):
# If the text has been changed
self.articleElement.process(request)
if "action" in request.args \
and request.args["action"][0] == "done":
# remove the undo flag in order to reenable it next time:
if hasattr(self.idevice,'undo'):
del self.idevice.undo
开发者ID:UstadMobile,项目名称:exelearning-extjs5-mirror,代码行数:46,代码来源:wikipediablock.py
示例8: process
def process(self, request):
"""
Process the request arguments from the web server to see if any
apply to this block
"""
log.debug("process " + repr(request.args))
is_cancel = common.requestHasCancel(request)
# If they hit "the tick" instead of "load"
Block.process(self, request)
if (u"action" not in request.args \
or request.args[u"action"][0] != u"delete"):
# If the text has been changed
self.articleElement.process(request)
if ("action" in request.args and request.args["action"][0] == "done" or not self.idevice.edit):
if hasattr(self.idevice, 'undo'):
del self.idevice.undo
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:18,代码来源:tocblock.py
示例9: process
def process(self, request):
"""
Process the request arguments from the web server to see if any
apply to this block
"""
log.debug("process " + repr(request.args))
is_cancel = common.requestHasCancel(request)
if 'emphasis'+self.id in request.args \
and not is_cancel:
self.idevice.emphasis = int(request.args['emphasis'+self.id][0])
# disable Undo once an emphasis has changed:
self.idevice.undo = False
if 'title'+self.id in request.args \
and not is_cancel:
self.idevice.title = request.args['title'+self.id][0]
if 'kpse' + self.id in request.args and not is_cancel:
path = \
request.args['kpse' + self.id][0]
if not os.path.isdir(path):
path = os.path.dirname(path)
self.idevice.latexpath = path
self.idevice.set_env()
if 'loadSource'+self.id in request.args:
# If they've hit "load" instead of "the tick"
self.idevice.source = request.args['path' + self.id][0]
self.idevice.loadSource()
# disable Undo once an article has been loaded:
self.idevice.undo = False
else:
# If they hit "the tick" instead of "load"
Block.process(self, request)
if (u"action" not in request.args \
or request.args[u"action"][0] != u"delete"):
# If the text has been changed
self.articleElement.process(request)
if ("action" in request.args and request.args["action"][0] == "done" or not self.idevice.edit):
if hasattr(self.idevice, 'undo'):
del self.idevice.undo
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:42,代码来源:latexblock.py
示例10: process
def process(self, request):
"""
Process the request arguments from the web server to see if any
apply to this block
"""
log.debug("process " + repr(request.args))
is_cancel = common.requestHasCancel(request)
if 'emphasis'+self.id in request.args \
and not is_cancel:
self.idevice.emphasis = int(request.args['emphasis'+self.id][0])
if 'site'+self.id in request.args \
and not is_cancel:
self.idevice.site = request.args['site'+self.id][0]
if 'title'+self.id in request.args \
and not is_cancel:
self.idevice.title = request.args['title'+self.id][0]
if "url" + self.id in request.args \
and not is_cancel:
self.idevice.url = request.args['url'+ self.id][0]
if 'loadRss'+self.id in request.args \
and not is_cancel:
# disable Undo once a question has been added:
self.idevice.undo = False
self.idevice.loadRss(request.args['url'+ self.id][0])
else:
Block.process(self, request)
if (u"action" not in request.args or
request.args[u"action"][0] != u"delete"):
# If the text has been changed
self.rssElement.process(request)
if "action" in request.args \
and request.args["action"][0] == "done":
# remove the undo flag in order to reenable it next time:
if hasattr(self.idevice,'undo'):
del self.idevice.undo
开发者ID:Rafav,项目名称:iteexe,代码行数:41,代码来源:rssblock.py
示例11: process
def process(self, request):
"""
Sets the encodedContent of our field
"""
is_cancel = common.requestHasCancel(request)
if is_cancel:
self.field.idevice.edit = False
# but double-check for first-edits, and ensure proper attributes:
if not hasattr(self.field, 'content_w_resourcePaths'):
self.field.content_w_resourcePaths = ""
self.field.idevice.edit = True
if not hasattr(self.field, 'content_wo_resourcePaths'):
self.field.content_wo_resourcePaths = ""
self.field.idevice.edit = True
return
if self.editorId in request.args:
# process any new images and other resources courtesy of tinyMCE:
self.field.content_w_resourcePaths = \
self.field.ProcessPreviewed(request.args[self.editorId][0])
# likewise determining the paths for exports, etc.:
self.field.content_wo_resourcePaths = \
self.field.MassageContentForRenderView(\
self.field.content_w_resourcePaths)
# and begin by choosing the content for preview mode, WITH paths:
self.field.encodedContent = self.field.content_w_resourcePaths
if "clOtras"+self.id in request.args :
totras=request.args["clOtras"+self.id][0]
self.field.otras = totras
else:
if "clozeOtras"+self.id in request.args :
totras=request.args["clozeOtras"+self.id][0]
self.field.otras = self.dcrypt(totras)
"""
开发者ID:UstadMobile,项目名称:exelearning-ustadmobile-work,代码行数:41,代码来源:listablock.py
示例12: process
def process(self, request):
"""
Process the request arguments from the web server to see if any
apply to this block
"""
Block.process(self, request)
is_cancel = common.requestHasCancel(request)
if "title"+self.id in request.args:
self.idevice.title = request.args["title"+self.id][0]
if ("addTerm" + self.id) in request.args:
self.idevice.addTerm()
self.idevice.edit = True
self.idevice.undo = False
for element in self.termElements:
element.process(request)
if ("action" in request.args and request.args["action"][0] == "done"
or not self.idevice.edit):
# remove the undo flag in order to reenable it next time:
if hasattr(self.idevice,'undo'):
del self.idevice.undo
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:22,代码来源:glossaryblock.py
示例13: process
def process(self, request):
"""
Process the request arguments from the web server
"""
is_cancel = common.requestHasCancel(request)
Block.process(self, request)
if (u"action" not in request.args or
request.args[u"action"][0] != u"delete"):
for element in self.elements:
element.process(request)
if "address" + self.id in request.args and not is_cancel:
if request.args["address" + self.id][0] == self.package.email:
self.idevice.address = ""
else:
self.idevice.address = request.args["address" + self.id][0]
if "subject" + self.id in request.args and not is_cancel:
self.idevice.subject = request.args["subject" + self.id][0]
if "comment" + self.id in request.args and not is_cancel:
self.idevice.comment = request.args["comment" + self.id][0]
if "title"+self.id in request.args:
self.idevice.title = request.args["title"+self.id][0]
开发者ID:KatiaBorges,项目名称:exeLearning,代码行数:22,代码来源:feedbackblock.py
示例14: process
def process(self, request):
is_cancel = common.requestHasCancel(request)
if self.id in request.args and not is_cancel:
self.field.content = request.args[self.id][0]
开发者ID:Rafav,项目名称:iteexe,代码行数:4,代码来源:extendedfieldengine.py
注:本文中的exe.webui.common.requestHasCancel函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论