本文整理汇总了Python中pyasm.search.DbContainer.abort_thread_sql方法的典型用法代码示例。如果您正苦于以下问题:Python DbContainer.abort_thread_sql方法的具体用法?Python DbContainer.abort_thread_sql怎么用?Python DbContainer.abort_thread_sql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyasm.search.DbContainer
的用法示例。
在下文中一共展示了DbContainer.abort_thread_sql方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: preprocess
# 需要导入模块: from pyasm.search import DbContainer [as 别名]
# 或者: from pyasm.search.DbContainer import abort_thread_sql [as 别名]
#.........这里部分代码省略.........
context = my.get_option('icon_context')
if not context and my.sobjects:
sobject = my.sobjects[0]
assert(sobject)
if sobject: # protect agains it being None
context = sobject.get_icon_context(my.context)
if context:
my.context = context
if not my.image_link_order:
order = my.get_option('image_link_order')
if order:
order = order.split('|')
my.set_image_link_order(order)
# preselect all of the snapshots (don't do this for redirect right now)
redirect = my.get_option("redirect")
redirect_expr = my.get_option("redirect_expr")
if not redirect and not redirect_expr and my.sobjects:
if not my.sobjects[0]:
# retired
return
snapshots = []
# if it is snapshot, there is no need to search for it again
# and we dont' try to to look for publish context icons for it to save time
if isinstance(my.sobjects[0], Snapshot):
snapshots = my.sobjects
else:
if my.show_latest_icon:
icon_context = None
else:
icon_context = my.sobjects[0].get_icon_context(my.context)
try:
if my.version == None:
my.data = Snapshot.get_by_sobjects(my.sobjects, icon_context, is_latest=True, return_dict=True)
# verify if we get icon for all
if len(my.data) < len(my.sobjects):
publish_data = Snapshot.get_by_sobjects(my.sobjects, my.DEFAULT_CONTEXT, is_latest=True, return_dict=True)
my._update_data(publish_data)
# verify if we get icon for all
if len(my.data) < len(my.sobjects):
publish_data = Snapshot.get_by_sobjects(my.sobjects, process=my.DEFAULT_PROCESS, is_latest=True, return_dict=True)
my._update_data(publish_data)
# verify if we get icon for all
if len(my.data) < len(my.sobjects):
publish_data = Snapshot.get_by_sobjects(my.sobjects, is_latest=True, return_dict=True)
my._update_data(publish_data)
else:
my.data = Snapshot.get_by_sobjects(my.sobjects, icon_context, version=my.version, return_dict=True)
# verify if we get icon for all
if len(my.data) < len(my.sobjects):
publish_data = Snapshot.get_by_sobjects(my.sobjects, my.DEFAULT_CONTEXT, version=my.version, return_dict=True)
my._update_data(publish_data)
# verify if we get icon for all
if len(my.data) < len(my.sobjects):
publish_data = Snapshot.get_by_sobjects(my.sobjects, process=my.DEFAULT_PROCESS, version=my.version, return_dict=True)
my._update_data(publish_data)
# verify if we get icon for all
if len(my.data) < len(my.sobjects):
publish_data = Snapshot.get_by_sobjects(my.sobjects, version=my.version, return_dict=True)
my._update_data(publish_data)
except SqlException, e:
my.SQL_ERROR = True
DbContainer.abort_thread_sql()
return
snapshots = my.data.values()
# get all of the file objects
file_objects = File.get_by_snapshots(snapshots)
for file_object in file_objects:
file_code = file_object.get_code()
my.file_objects[file_code] = file_object
示例2: clear_search_data
# 需要导入模块: from pyasm.search import DbContainer [as 别名]
# 或者: from pyasm.search.DbContainer import abort_thread_sql [as 别名]
def clear_search_data(search_type, view=None):
DbContainer.abort_thread_sql(force=True)
key = SearchWdg._get_key(search_type, view)
WidgetSettings.set_value_by_key(key, '')