本文整理汇总了Python中pydev.pydevd.settrace函数的典型用法代码示例。如果您正苦于以下问题:Python settrace函数的具体用法?Python settrace怎么用?Python settrace使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了settrace函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: generateMoleculeHierarchyTask
def generateMoleculeHierarchyTask(structure, debug=False):
if debug:
pydevd.settrace('localhost', port=6901, stdoutToServer=True, stderrToServer=True)
molecule = structure.molecule
if not molecule.moleculeHierarchy:
hierarchy = MoleculeHierarchy(molecule=molecule)
else:
hierarchy = molecule.moleculeHierarchy
saltRemover = SaltRemover()
mol = Chem.MolFromMolBlock(str(structure.molfile))
base = saltRemover.StripMol(mol)
if mol.GetNumAtoms() == base.GetNumAtoms():
hierarchy.parent_molecule = molecule
else:
hierarchy.parent_molecule = getParentMolregnoFromBase(MolToMolBlock(base))
hierarchy.active_molecule = hierarchy.parent_molecule
try:
hierarchy.save()
except IntegrityError as e:
if debug:
print e.message
else:
raise e
开发者ID:thesgc,项目名称:chembiohub_ws,代码行数:30,代码来源:tasks.py
示例2: init
def init():
from oslo.config import cfg
CONF = cfg.CONF
if 'remote_debug' not in CONF:
return
if not(CONF.remote_debug.host and CONF.remote_debug.port):
return
from mvpn.openstack.common.gettextutils import _
from mvpn.openstack.common import log as logging
LOG = logging.getLogger(__name__)
LOG.debug(_('Listening on %(host)s:%(port)s for debug connection'),
{'host': CONF.remote_debug.host,
'port': CONF.remote_debug.port})
from pydev import pydevd
pydevd.settrace(host=CONF.remote_debug.host,
port=CONF.remote_debug.port,
stdoutToServer=True,
stderrToServer=True)
LOG.warn(_('WARNING: Using the remote debug option changes how '
'Nova uses the eventlet library to support async IO. This '
'could result in failures that do not occur under normal '
'operation. Use at your own risk.'))
开发者ID:windskyer,项目名称:mvpn,代码行数:25,代码来源:debugger.py
示例3: generateCompoundImageTask
def generateCompoundImageTask(structure, debug=False):
if debug:
from pydev import pydevd
pydevd.settrace('localhost', port=6901, stdoutToServer=True, stderrToServer=True)
molecule = structure.molecule
if not molecule.compoundImage:
img = CompoundImages(molecule=molecule)
else:
img = molecule.compoundImage
mol = Chem.MolFromMolBlock(str(structure.molfile))
raw = Draw.MolToImage(mol, size=(500, 500))
raw_thumb = Draw.MolToImage(mol, size=(128, 128))
output = StringIO.StringIO()
raw.save(output, 'PNG')
img.png_500 = output.getvalue()
output.close()
output = StringIO.StringIO()
raw_thumb.save(output, 'PNG')
img.png = output.getvalue()
output.close()
try:
img.save()
except IntegrityError as e:
if debug:
print e.message
else:
raise e
开发者ID:thesgc,项目名称:chembiohub_ws,代码行数:34,代码来源:tasks.py
示例4: generateCompoundPropertiesTask
def generateCompoundPropertiesTask(structure, debug=False):
if debug:
pydevd.settrace('localhost', port=6901, stdoutToServer=True, stderrToServer=True)
molecule = structure.molecule
if not molecule.compoundProperty:
prop = CompoundProperties(molecule=molecule)
else:
prop = molecule.compoundProperty
saltRemover = SaltRemover()
mol = Chem.MolFromMolBlock(str(structure.molfile))
base = saltRemover.StripMol(mol)
prop.hbd = Descriptors.CalcNumHBD(mol)
prop.hba = Descriptors.CalcNumHBA(mol)
prop.rtb = Descriptors.CalcNumRotatableBonds(mol)
prop.alogp = Crippen.MolLogP(mol)
prop.psa = Descriptors.CalcTPSA(mol)
prop.full_mwt = NewDescriptors.MolWt(mol)
# prop.exact_mass = Descriptors.CalcExactMolWt(mol)
if base.GetNumAtoms():
prop.mw_freebase = NewDescriptors.MolWt(base)
prop.full_molformula = Descriptors.CalcMolFormula(mol)
try:
prop.save()
except IntegrityError as e:
if debug:
print e.message
else:
raise e
开发者ID:thesgc,项目名称:chembiohub_ws,代码行数:35,代码来源:tasks.py
示例5: generateMoleculeHierarchyFromPipelinePilot
def generateMoleculeHierarchyFromPipelinePilot(structure, debug=False):
if debug:
pydevd.settrace('localhost', port=6901, stdoutToServer=True, stderrToServer=True)
molecule = structure.molecule
if not molecule.moleculeHierarchy:
hierarchy = MoleculeHierarchy(molecule=molecule)
else:
hierarchy = molecule.moleculeHierarchy
data = cleanup(structure.molfile, 'stripsalts')
if not data['UPDATED']:
hierarchy.parent_molecule = molecule
else:
hierarchy.parent_molecule = getParentMolregnoFromBase(data['UPDATEDCTAB'])
hierarchy.active_molecule = hierarchy.parent_molecule
try:
hierarchy.save()
except IntegrityError as e:
if debug:
print e.message
else:
raise e
开发者ID:thesgc,项目名称:chembiohub_ws,代码行数:28,代码来源:tasks.py
示例6: init
def init():
from oslo.config import cfg
CONF = cfg.CONF
# NOTE(markmc): gracefully handle the CLI options not being registered
if 'remote_debug' not in CONF:
return
if not (CONF.remote_debug.host and CONF.remote_debug.port):
return
from nova.i18n import _
from nova.openstack.common import log as logging
LOG = logging.getLogger(__name__)
LOG.debug('Listening on %(host)s:%(port)s for debug connection',
{'host': CONF.remote_debug.host,
'port': CONF.remote_debug.port})
try:
from pydev import pydevd
except ImportError:
import pydevd
pydevd.settrace(host=CONF.remote_debug.host,
port=CONF.remote_debug.port,
stdoutToServer=False,
stderrToServer=False)
LOG.warn(_('WARNING: Using the remote debug option changes how '
'Nova uses the eventlet library to support async IO. This '
'could result in failures that do not occur under normal '
'operation. Use at your own risk.'))
开发者ID:AsherBond,项目名称:nova,代码行数:32,代码来源:debugger.py
示例7: pytest_configure
def pytest_configure(config):
socket = config.getvalue('pydevd')
if socket is not None:
addr, port = socket.split(':')
# prepend path to sys.path
path = config.getvalue('pydev_lib')
if path:
sys.path.insert(0, os.path.expandvars(os.path.expanduser(path)))
redirect = config.getvalue('pydevd_io')
stdout = redirect in ('both', 'stdout')
stderr = redirect in ('both', 'stderr')
from pydev import pydevd
# salvaged from pydev's source:
# - host: the user may specify another host, if the debug server is not
# in the same machine
# - stdoutToServer: when this is true, the stdout is passed to the debug
# server
# - stderrToServer: when this is true, the stderr is passed to the debug
# server so that they are printed in its console and not in this
# process console.
# - port: specifies which port to use for communicating with the server
# (note that the server must be started in the same port). @note:
# currently it's hard-coded at 5678 in the client
# - suspend: whether a breakpoint should be emulated as soon as this
# function is called.
# - trace_only_current_thread: determines if only the current thread
# will be traced or all future threads will also have the tracing
# enabled.
pydevd.settrace(host=addr, port=int(port), suspend=False,
stdoutToServer=stdout, stderrToServer=stderr,
trace_only_current_thread=False, overwrite_prev_trace=False)
开发者ID:viktorijat,项目名称:timezones_site_test,代码行数:35,代码来源:pytest_pydev.py
示例8: test_remote_debug
def test_remote_debug(self):
import sys
sys.path.append('/home/api-dependencies/pycharm-debug.egg')
from pydev import pydevd
pydevd.settrace('192.168.1.11', port=51234, stdoutToServer=True, stderrToServer=True)
print "foo"
print "step 1"
print "step 2"
开发者ID:ralphbrooks,项目名称:gift-card-trading,代码行数:9,代码来源:APITestCase.py
示例9: _enable_pydev
def _enable_pydev(debugger_host, debugger_port):
try:
from pydev import pydevd
except ImportError:
import pydevd
pydevd.settrace(debugger_host,
port=int(debugger_port),
stdoutToServer=True,
stderrToServer=True)
开发者ID:openstack,项目名称:octavia,代码行数:10,代码来源:config.py
示例10: create
def create(cls, host=None, binary=None, topic=None, manager=None,
report_interval=None, periodic_enable=None,
periodic_fuzzy_delay=None, periodic_interval_max=None,
db_allowed=True):
"""Instantiates class and passes back application object.
:param host: defaults to CONF.host
:param binary: defaults to basename of executable
:param topic: defaults to bin_name - 'nova-' part
:param manager: defaults to CONF.<topic>_manager
:param report_interval: defaults to CONF.report_interval
:param periodic_enable: defaults to CONF.periodic_enable
:param periodic_fuzzy_delay: defaults to CONF.periodic_fuzzy_delay
:param periodic_interval_max: if set, the max time to wait between runs
"""
if not host:
host = CONF.host
if not binary:
binary = os.path.basename(sys.argv[0])
if not topic:
topic = binary.rpartition('nova-')[2]
if not manager:
manager_cls = ('%s_manager' %
binary.rpartition('nova-')[2])
manager = CONF.get(manager_cls, None)
if report_interval is None:
report_interval = CONF.report_interval
if periodic_enable is None:
periodic_enable = CONF.periodic_enable
if periodic_fuzzy_delay is None:
periodic_fuzzy_delay = CONF.periodic_fuzzy_delay
if CONF.remote_debug.host and CONF.remote_debug.port:
from pydev import pydevd
LOG = logging.getLogger('nova')
LOG.debug(_('Listening on %(host)s:%(port)s for debug connection'),
{'host': CONF.remote_debug.host,
'port': CONF.remote_debug.port})
pydevd.settrace(host=CONF.remote_debug.host,
port=CONF.remote_debug.port,
stdoutToServer=False,
stderrToServer=False)
LOG.warn(_('WARNING: Using the remote debug option changes how '
'Nova uses the eventlet library to support async IO. This '
'could result in failures that do not occur under normal '
'operation. Use at your own risk.'))
service_obj = cls(host, binary, topic, manager,
report_interval=report_interval,
periodic_enable=periodic_enable,
periodic_fuzzy_delay=periodic_fuzzy_delay,
periodic_interval_max=periodic_interval_max,
db_allowed=db_allowed)
return service_obj
开发者ID:weitian,项目名称:nova,代码行数:55,代码来源:service.py
示例11: debug_here
def debug_here():
# append pydev remote debugger
if REMOTE_DBG:
# Make pydev debugger works for auto reload.
# Note pydevd module need to be copied in XBMC\system\python\Lib\pysrc
try:
from pydev import pydevd
pydevd.settrace('localhost', port=5678, stdoutToServer=True, stderrToServer=True)
except ImportError:
sys.stderr.write("Error: " +
"You must add org.python.pydev.debug.pysrc to your PYTHONPATH.")
sys.exit(1)
开发者ID:RockingRolli,项目名称:plugin.video.ustream,代码行数:13,代码来源:default.py
示例12: breakpoint
def breakpoint():
try:
pydevd.settrace(
"localhost",
port=10000,
stdoutToServer=True,
stderrToServer=True,
suspend=True,
trace_only_current_thread=True,
overwrite_prev_trace=True,
)
except Exception:
pass
开发者ID:parroit,项目名称:mvc.x,代码行数:14,代码来源:remote_debugger.py
示例13: ConnectDebugger
def ConnectDebugger(host_ovr=None, port_ovr=None):
"""
Connect a listening Eclipse debugger
"""
from pydev import pydevd
if pydevd.connected:
GEUtil.Warning("In order to run another debug session you MUST restart the game.\n")
return
if port_ovr:
pydevd.settrace(host=host_ovr, port=port_ovr, suspend=False)
else:
pydevd.settrace(host=host_ovr, suspend=False)
GEUtil.Msg("Python debugger successfully connected!\n")
开发者ID:J-Shep,项目名称:ges-python,代码行数:16,代码来源:ge_debugger.py
示例14: setup_remote_pydev_debug
def setup_remote_pydev_debug():
if CONF.pydev_debug_host and CONF.pydev_debug_port:
error_msg = ('Error setting up the debug environment. Verify that the'
' option --debug-url has the format <host>:<port> and '
'that a debugger processes is listening on that port.')
try:
from pydev import pydevd
pydevd.settrace(CONF.pydev_debug_host,
port=CONF.pydev_debug_port,
stdoutToServer=True,
stderrToServer=True)
return True
except:
LOG.exception(_(error_msg))
raise
开发者ID:StackOps,项目名称:keystone,代码行数:17,代码来源:utils.py
示例15: setup_remote_pydev_debug
def setup_remote_pydev_debug(host, port):
error_msg = ('Error setting up the debug environment. Verify that the'
' option pydev_worker_debug_port is pointing to a valid '
'hostname or IP on which a pydev server is listening on'
' the port indicated by pydev_worker_debug_port.')
try:
from pydev import pydevd
pydevd.settrace(host,
port=port,
stdoutToServer=True,
stderrToServer=True)
return True
except:
LOG.exception(error_msg)
raise
开发者ID:GiantTao,项目名称:openstack-ubuntu-14-04,代码行数:18,代码来源:utils.py
示例16: setup_remote_pydev_debug
def setup_remote_pydev_debug():
if CONF.pydev_debug_host and CONF.pydev_debug_port:
try:
try:
from pydev import pydevd
except ImportError:
import pydevd
pydevd.settrace(CONF.pydev_debug_host, port=CONF.pydev_debug_port, stdoutToServer=True, stderrToServer=True)
return True
except Exception:
LOG.exception(
_(
"Error setting up the debug environment. Verify that the "
"option --debug-url has the format <host>:<port> and that a "
"debugger processes is listening on that port."
)
)
raise
开发者ID:jettang,项目名称:icehouse,代码行数:19,代码来源:utils.py
示例17: setup_remote_pydev_debug
def setup_remote_pydev_debug(host, port):
error_msg = _LE(
"Error setting up the debug environment. Verify that the"
" option pydev_worker_debug_host is pointing to a valid "
"hostname or IP on which a pydev server is listening on"
" the port indicated by pydev_worker_debug_port."
)
try:
try:
from pydev import pydevd
except ImportError:
import pydevd
pydevd.settrace(host, port=port, stdoutToServer=True, stderrToServer=True)
return True
except Exception:
with excutils.save_and_reraise_exception():
LOG.exception(error_msg)
开发者ID:wgapl,项目名称:glance,代码行数:19,代码来源:utils.py
示例18: setup_remote_pydev_debug
def setup_remote_pydev_debug():
"""Required setup for remote debugging."""
if CONF.pydev_debug_host and CONF.pydev_debug_port:
try:
try:
from pydev import pydevd
except ImportError:
import pydevd
pydevd.settrace(CONF.pydev_debug_host,
port=int(CONF.pydev_debug_port),
stdoutToServer=True,
stderrToServer=True)
except Exception:
LOG.exception('Unable to join debugger, please '
'make sure that the debugger processes is '
'listening on debug-host \'%s\' debug-port \'%s\'.',
CONF.pydev_debug_host, CONF.pydev_debug_port)
raise
开发者ID:gluegl,项目名称:barbican,代码行数:20,代码来源:config.py
示例19: init
def init():
from oslo.config import cfg
CONF = cfg.CONF
if 'remote_debug' not in CONF:
return
if not (CONF.remote_debug.host and CONF.remote_debug.port):
return
from xdrs.openstack.common.gettextutils import _
from xdrs.openstack.common import log as logging
LOG = logging.getLogger(__name__)
LOG.debug(_('Listening on %(host)s:%(port)s for debug connection'),
{'host': CONF.remote_debug.host,
'port': CONF.remote_debug.port})
from pydev import pydevd
pydevd.settrace(host=CONF.remote_debug.host,
port=CONF.remote_debug.port,
stdoutToServer=False,
stderrToServer=False)
开发者ID:liuliuxiaoge,项目名称:XDRS,代码行数:23,代码来源:debugger.py
示例20: init
def init():
from oslo.config import cfg
CONF = cfg.CONF
# NOTE(markmc): gracefully handle the CLI options not being registered
if "remote_debug" not in CONF:
return
if not (CONF.remote_debug.host and CONF.remote_debug.port):
return
from rack.openstack.common.gettextutils import _
from rack.openstack.common import log as logging
LOG = logging.getLogger(__name__)
LOG.debug(
_("Listening on %(host)s:%(port)s for debug connection"),
{"host": CONF.remote_debug.host, "port": CONF.remote_debug.port},
)
from pydev import pydevd
pydevd.settrace(
host=CONF.remote_debug.host, port=CONF.remote_debug.port, stdoutToServer=False, stderrToServer=False
)
LOG.warn(
_(
"WARNING: Using the remote debug option changes how "
"Rack uses the eventlet library to support async IO. This "
"could result in failures that do not occur under normal "
"operation. Use at your own risk."
)
)
开发者ID:n-nishida,项目名称:rack,代码行数:36,代码来源:debugger.py
注:本文中的pydev.pydevd.settrace函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论