Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def run(self):
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
print 'Thread enabled interactive eclipse debuging...'
except:
pass
try:
self._run()
except MultiprocessingException, e:
msg = e.msg
logger = logging.getLogger()
logger.error(msg)
self.analyzer_error.emit(msg)
raise
except:
msg = traceback.format_exc()
logger = logging.getLogger()
def run(self):
self.running = True
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
except:
# do nothing, since error message only indicates we are not in debug mode
pass
#startTime=time.time()
for simulator in self.allSimulators:
simulatorName = simulator.__name__.rsplit('.', 1)[-1]
fullSimulatorResultPath = self.resultDir + '/' + simulatorName
if os.path.isdir(fullSimulatorResultPath) and self.deleteDir:
for file_object in os.listdir(fullSimulatorResultPath):
file_object_path = os.path.join(fullSimulatorResultPath, file_object)
if os.path.isfile(file_object_path):
os.unlink(file_object_path)
else:
shutil.rmtree(file_object_path)
def _enable_eclipse_mt_debugging(self):
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
print 'Thread enabled interactive eclipse debuging...'
except:
pass
def run(self):
haveCOM = False
try:
'''
Do the numerical integration in a try branch
to avoid losing the thread when an intended exception is raised
'''
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
except:
# do nothing, since error message only indicates we are not in debug mode
pass
try:
import pythoncom
pythoncom.CoInitialize() # Initialize the COM library on the current thread
haveCOM = True
except:
pass
self.model.simulate()
except SimulatorBase.Stopping:
print("solver canceled ... ")
except Exception, e:
print("unexpected error ... ")
print e
def run(self):
self.running = True
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
except:
# do nothing, since error message only indicates we are not in debug mode
pass
workdir=os.getcwd()
encoding = sys.getfilesystemencoding()
dir1 = self.dir1
files1 = os.listdir(dir1)
if (len(files1)!=0):
subdir=self.logDir
## clear the regression report directory if already exists
if os.path.exists(subdir):
shutil.rmtree(subdir, True)
def __init__(self, P, channel_regions, filename_hdf5, meta_data, settings,
analysis_frames, plate_id,
hdf5_create=True, hdf5_reuse=True, hdf5_compression='gzip',
hdf5_include_raw_images=True,
hdf5_include_label_images=True, hdf5_include_features=True,
hdf5_include_classification=True, hdf5_include_crack=True,
hdf5_include_tracking=True, hdf5_include_events=True,
hdf5_include_annotation=True):
super(TimeHolder, self).__init__()
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
print 'Thread enabled interactive eclipse debuging...'
except:
pass
self.P = P
self.plate_id = plate_id
self._iCurrentT = None
self.channel_regions = channel_regions
self._meta_data = meta_data
self._settings = settings
self._analysis_frames = analysis_frames
self.reginfo = MetaPluginManager().region_info
self._hdf5_create = hdf5_create
self._hdf5_include_raw_images = hdf5_include_raw_images
self._hdf5_include_label_images = hdf5_include_label_images
def enable_eclipse_debuging():
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
print 'Thread enabled interactive eclipse debuging...'
except:
pass
def run(self):
self.running = True
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
except:
# do nothing, since error message only indicates we are not in debug mode
pass
encoding = sys.getfilesystemencoding()
### create a new subdirectory if the user specifies in the directory of results in the GUI ###
subdir=self.logDir
if not os.path.exists(subdir):
os.mkdir(subdir)
### copy the dygraph script from /Plugins/Analysis/Testing/ to the result directory ###
dygraphpath=os.path.join(self.PySimulatorPath, 'Plugins/Analysis/Testing/dygraph-combined.js').replace('\\','/')
if os.path.exists(dygraphpath):
# stop any existing debugger
dbg = pydevd.GetGlobalDebugger()
if dbg:
dbg.FinishDebuggingSession()
time.sleep(0.1)
pydevd_tracing.SetTrace(None)
# remove any additional info for the current thread
try:
del threading.currentThread().__dict__["additionalInfo"]
except KeyError:
pass
pydevd.SetGlobalDebugger(None)
pydevd.connected = False
time.sleep(0.1)
# do this a couple of times as when re-connecting the first doesn't work
_logger.info("Attempting to attach to the pydev debugger")
if not ipython_active():
pydevd.settrace(stdoutToServer=True, stderrToServer=True, suspend=False)
pydevd.settrace(stdoutToServer=True, stderrToServer=True, suspend=False)
else:
pydevd.settrace(stdoutToServer=False, stderrToServer=False, suspend=False)
pydevd.settrace(stdoutToServer=False, stderrToServer=False, suspend=False)
_logger.info("Attached to PyDev")
def enable_eclipse_debuging():
try:
import pydevd
pydevd.connected = True
pydevd.settrace(suspend=False)
print 'Thread enabled interactive eclipse debuging...'
except:
pass