本文整理汇总了Python中vistrails.core.debug.unexpected_exception函数的典型用法代码示例。如果您正苦于以下问题:Python unexpected_exception函数的具体用法?Python unexpected_exception怎么用?Python unexpected_exception使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了unexpected_exception函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: open_workflow
def open_workflow(self, locator):
if isinstance(locator, basestring):
locator = BaseLocator.from_url(locator)
new_locator = UntitledLocator()
controller = self.open_vistrail(new_locator)
try:
if locator is None:
return False
workflow = locator.load(Pipeline)
action_list = []
for module in workflow.module_list:
action_list.append(('add', module))
for connection in workflow.connection_list:
action_list.append(('add', connection))
action = vistrails.core.db.action.create_action(action_list)
controller.add_new_action(action)
controller.perform_action(action)
controller.vistrail.set_tag(action.id, "Imported workflow")
controller.change_selected_version(action.id)
except VistrailsDBException as e:
debug.unexpected_exception(e)
debug.critical("Exception from the database: %s" % e,
debug.format_exc())
return None
controller.select_latest_version()
controller.set_changed(True)
return controller
开发者ID:anukat2015,项目名称:VisTrails,代码行数:29,代码来源:application.py
示例2: get_wsdl_from_namespace
def get_wsdl_from_namespace(m_namespace):
try:
wsdl = m_namespace.split("|")
return wsdl[0]
except Exception, e:
debug.unexpected_exception(e)
return None
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:7,代码来源:init.py
示例3: compute
def compute(self):
# create dict of inputs
cacheable = False
if self.has_input('cacheable'):
cacheable = self.get_input('cacheable')
self.is_cacheable = lambda *args, **kwargs: cacheable
params = {}
mname = self.wsmethod.qname[0]
for name in self.wsmethod.inputs:
name = str(name)
if self.has_input(name):
params[name] = self.get_input(name)
if params[name].__class__.__name__ == 'UberClass':
params[name] = params[name].value
params[name] = self.service.makeDictType(params[name])
try:
#import logging
#logging.basicConfig(level=logging.INFO)
#logging.getLogger('suds.client').setLevel(logging.DEBUG)
#print "params:", str(params)[:400]
#self.service.service.set_options(retxml = True)
#result = getattr(self.service.service.service, mname)(**params)
#print "result:", str(result)[:400]
#self.service.service.set_options(retxml = False)
result = getattr(self.service.service.service, mname)(**params)
except Exception, e:
debug.unexpected_exception(e)
raise ModuleError(self, "Error invoking method %s: %s" % (
mname, debug.format_exception(e)))
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:29,代码来源:init.py
示例4: _convert_version
def _convert_version(self, version):
if isinstance(version, basestring):
try:
version = \
self.controller.vistrail.get_version_number(version)
except Exception, e:
debug.unexpected_exception(e)
raise ValueError('Cannot locate version "%s"' % version)
开发者ID:tacaswell,项目名称:VisTrails,代码行数:8,代码来源:api.py
示例5: convert_version
def convert_version(self, version):
if isinstance(version, basestring):
try:
version = \
self.get_controller().vistrail.get_version_number(version)
except Exception, e:
debug.unexpected_exception(e)
version = None
开发者ID:sameera2004,项目名称:VisTrails,代码行数:8,代码来源:application.py
示例6: get_used_packages
def get_used_packages(self):
package_list = {}
for action in self.actions:
for op in action.operations:
try:
if isinstance(op, AddOp) and op.what == 'module':
package_list[op.data.package] = op.data.package
except AttributeError, e:
debug.unexpected_exception(e)
开发者ID:Nikea,项目名称:VisTrails,代码行数:9,代码来源:vistrail.py
示例7: evaluate
def evaluate(i):
try:
v = d['value'](i)
if v is None:
return module.default_value
return v
except Exception, e:
debug.unexpected_exception(e)
return debug.format_exception(e)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:9,代码来源:paramexplore.py
示例8: saveVistrailFileHook
def saveVistrailFileHook(self, vistrail, tmp_dir):
if hasattr(self._init_module, 'saveVistrailFileHook'):
try:
self._init_module.saveVistrailFileHook(vistrail, tmp_dir)
except Exception, e:
debug.unexpected_exception(e)
debug.critical("Got exception in %s's saveVistrailFileHook(): "
"%s\n%s" % (self.name,
debug.format_exception(e),
traceback.format_exc()))
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:10,代码来源:package.py
示例9: send_notification
def send_notification(self, notification_id, *args):
# do global notifications
if notification_id in self.notifications:
# print 'global notification ', notification_id
for m in self.notifications[notification_id]:
try:
#print " m: ", m
m(*args)
except Exception, e:
debug.unexpected_exception(e)
traceback.print_exc()
开发者ID:sameera2004,项目名称:VisTrails,代码行数:11,代码来源:application.py
示例10: runAndGetCellEvents
def runAndGetCellEvents(self, useDefaultValues=False):
spreadsheetController.setEchoMode(True)
# will run to get Spreadsheet Cell events
cellEvents = []
errors = []
try:
(res, errors) = self.run(useDefaultValues)
if res:
cellEvents = spreadsheetController.getEchoCellEvents()
except Exception, e:
debug.unexpected_exception(e)
print "Executing pipeline failed:", debug.format_exc()
开发者ID:hjanime,项目名称:VisTrails,代码行数:12,代码来源:mashup_app.py
示例11: menu_items
def menu_items(self):
try:
callable_ = self._module.menu_items
except AttributeError:
return None
else:
try:
return callable_()
except Exception, e:
debug.unexpected_exception(e)
debug.critical("Couldn't load menu items for %s: %s\n%s" % (
self.name, debug.format_exception(e),
traceback.format_exc()))
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:13,代码来源:package.py
示例12: can_handle_vt_file
def can_handle_vt_file(self, name):
""" Asks package if it can handle a file inside a zipped vt file
"""
try:
return (hasattr(self.init_module, 'can_handle_vt_file') and
self.init_module.can_handle_vt_file(name))
except Exception, e:
debug.unexpected_exception(e)
debug.critical("Got exception calling %s's can_handle_vt_file: "
"%s\n%s" % (self.name,
debug.format_exception(e),
traceback.format_exc()))
return False
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:13,代码来源:package.py
示例13: can_handle_identifier
def can_handle_identifier(self, identifier):
""" Asks package if it can handle this package
"""
try:
return (hasattr(self.init_module, 'can_handle_identifier') and
self.init_module.can_handle_identifier(identifier))
except Exception, e:
debug.unexpected_exception(e)
debug.critical("Got exception calling %s's can_handle_identifier: "
"%s\n%s" % (self.name,
debug.format_exception(e),
traceback.format_exc()))
return False
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:13,代码来源:package.py
示例14: menu_items
def menu_items():
"""menu_items() -> tuple of (str,function)
It returns a list of pairs containing text for the menu and a
callback function that will be executed when that menu item is selected.
"""
try:
from wizard import QCLToolsWizardWindow
except Exception, e: # pragma: no cover
if "CLTools" == identifiers.name:
debug.unexpected_exception(e)
raise
else:
return
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:14,代码来源:init.py
示例15: reload
def reload(self, vistrail):
if vistrail is not None:
self.set_vistrail(vistrail)
for version_id in self.vistrail.get_tagMap():
self.add_workflow_entity(version_id)
#mashups
if hasattr(self.vistrail, 'mashups'):
self._mshp_tag_map = {}
for mashuptrail in self.vistrail.mashups:
self._mshp_tag_map[mashuptrail.id] = \
self.add_mashup_entities_from_mashuptrail(mashuptrail)
#parameter explorations
if hasattr(self.vistrail, 'parameter_explorations'):
self.pe_entity_map = {}
# find named pe's
#max_pe = {}
for pe in self.vistrail.parameter_explorations:
if pe.name:
self.pe_entity_map[pe.name] = \
self.add_parameter_exploration_entity(pe)
# if pe.action_id not in max_pe or max_pe[pe.action_id]<pe.id:
# max_pe[pe.action_id] = pe
#for pe in max_pe.values():
# if pe.id not in self.pe_entity_map:
# self.pe_entity_map[pe.id] = \
# self.add_parameter_exploration_entity(pe)
# read persisted log entries
log = None
try:
log = vistrail.get_persisted_log()
except Exception, e:
debug.unexpected_exception(e)
import traceback
debug.critical("Failed to read log", traceback.format_exc())
if log is not None:
for wf_exec in log.workflow_execs:
self.add_wf_exec_entity(wf_exec, False)
# read unpersisted log entries
if vistrail.log is not None:
for wf_exec in self.vistrail.log.workflow_execs:
self.add_wf_exec_entity(wf_exec, True)
self._vt_tag_map = copy.copy(self.vistrail.get_tagMap())
开发者ID:amueller,项目名称:VisTrails,代码行数:50,代码来源:vistrail.py
示例16: add_workflow_entity
def add_workflow_entity(self, version_id):
if version_id not in self.vistrail.actionMap:
return
action = self.vistrail.actionMap[version_id]
tag = None
if self.vistrail.has_tag(version_id):
tag = self.vistrail.get_tag(version_id)
try:
workflow = self.vistrail.getPipeline(version_id)
except Exception, e:
debug.unexpected_exception(e)
debug.critical("Failed to construct pipeline '%s'" %
(tag if tag else version_id),
debug.format_exc())
workflow = self.vistrail.getPipeline(0)
开发者ID:Nikea,项目名称:VisTrails,代码行数:15,代码来源:vistrail.py
示例17: current_ip
def current_ip():
""" current_ip() -> str
Gets current IP address trying to avoid the IPv6 interface """
try:
info = socket.getaddrinfo(socket.gethostname(), None)
# Try to find an IPv4
for i in info:
if i[0] == socket.AF_INET:
return i[4][0]
# Return any address
for i in info:
if i[0] in (socket.AF_INET, socket.AF_INET6):
return i[4][0]
except Exception, e:
debug.unexpected_exception(e)
return ''
开发者ID:Nikea,项目名称:VisTrails,代码行数:16,代码来源:common.py
示例18: finalize
def finalize(self):
if not self._initialized:
return
debug.log("Finalizing %s" % self.name)
try:
callable_ = self._module.finalize
except AttributeError:
pass
else:
try:
callable_()
except Exception, e:
debug.unexpected_exception(e)
debug.critical("Couldn't finalize %s: %s\n%s" % (
self.name, debug.format_exception(e),
traceback.format_exc()))
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:16,代码来源:package.py
示例19: setParameterExplorationOld
def setParameterExplorationOld(self, xmlString):
""" setParameterExploration(xmlString: string) -> None
Sets the current parameter exploration to the one
defined by 'xmlString'.
"""
if not xmlString:
return
# Parse/validate the xml
try:
xmlDoc = parseString(xmlString).documentElement
except Exception, e:
debug.unexpected_exception(e)
debug.critical("Parameter Exploration load failed because of "
"invalid XML:\n\n%s" % xmlString)
return
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:16,代码来源:pe_table.py
示例20: contextMenuEvent
def contextMenuEvent(self, event):
"""Just dispatches the menu event to the widget item"""
item = self.itemAt(event.pos())
if item:
# find top level
p = item
while p.parent():
p = p.parent()
# get package identifier
assert isinstance(p, QPackageTreeWidgetItem)
identifier = p.identifier
registry = get_module_registry()
package = registry.packages[identifier]
try:
if package.has_context_menu():
if isinstance(item, QPackageTreeWidgetItem):
text = None
elif isinstance(item, QNamespaceTreeWidgetItem):
return # no context menu for namespaces
elif isinstance(item, QModuleTreeWidgetItem):
text = item.descriptor.name
if item.descriptor.namespace:
text = '%s|%s' % (item.descriptor.namespace, text)
else:
assert False, "fell through"
menu_items = package.context_menu(text)
if menu_items:
menu = QtGui.QMenu(self)
for text, callback in menu_items:
act = QtGui.QAction(text, self)
act.setStatusTip(text)
QtCore.QObject.connect(act,
QtCore.SIGNAL("triggered()"),
callback)
menu.addAction(act)
menu.exec_(event.globalPos())
return
except Exception, e:
debug.unexpected_exception(e)
debug.warning("Got exception trying to display %s's "
"context menu in the palette: %s\n%s" % (
package.name,
debug.format_exception(e),
traceback.format_exc()))
item.contextMenuEvent(event, self)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:46,代码来源:module_palette.py
注:本文中的vistrails.core.debug.unexpected_exception函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论