35 from time import localtime |
35 from time import localtime |
36 import shutil |
36 import shutil |
37 import re |
37 import re |
38 import tempfile |
38 import tempfile |
39 from types import ListType |
39 from types import ListType |
40 from threading import Timer, Lock, Thread |
40 from threading import Timer |
41 from datetime import datetime |
41 from datetime import datetime |
42 from weakref import WeakKeyDictionary |
42 from weakref import WeakKeyDictionary |
43 from itertools import izip |
43 from itertools import izip |
44 |
44 |
45 import wx |
45 import wx |
1437 values_buffer[-1] = (value, forced) |
1437 values_buffer[-1] = (value, forced) |
1438 else: |
1438 else: |
1439 values_buffer.append((value, forced)) |
1439 values_buffer.append((value, forced)) |
1440 self.DebugTicks.append(debug_tick) |
1440 self.DebugTicks.append(debug_tick) |
1441 |
1441 |
1442 |
|
1443 buffers, self.DebugValuesBuffers = (self.DebugValuesBuffers, |
1442 buffers, self.DebugValuesBuffers = (self.DebugValuesBuffers, |
1444 [list() for dummy in xrange(len(self.TracedIECPath))]) |
1443 [list() for dummy in xrange(len(self.TracedIECPath))]) |
1445 |
1444 |
1446 ticks, self.DebugTicks = self.DebugTicks, [] |
1445 ticks, self.DebugTicks = self.DebugTicks, [] |
1447 |
1446 |
1554 |
1553 |
1555 def ForceDebugIECVariable(self, IECPath, fvalue): |
1554 def ForceDebugIECVariable(self, IECPath, fvalue): |
1556 if IECPath not in self.IECdebug_datas: |
1555 if IECPath not in self.IECdebug_datas: |
1557 return |
1556 return |
1558 |
1557 |
1559 |
|
1560 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1558 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1561 IECdebug_data = self.IECdebug_datas.get(IECPath, None) |
1559 IECdebug_data = self.IECdebug_datas.get(IECPath, None) |
1562 IECdebug_data[2] = "Forced" |
1560 IECdebug_data[2] = "Forced" |
1563 IECdebug_data[3] = fvalue |
1561 IECdebug_data[3] = fvalue |
1564 |
1562 |
1565 |
|
1566 self.ReArmDebugRegisterTimer() |
1563 self.ReArmDebugRegisterTimer() |
1567 |
1564 |
1568 def ReleaseDebugIECVariable(self, IECPath): |
1565 def ReleaseDebugIECVariable(self, IECPath): |
1569 if IECPath not in self.IECdebug_datas: |
1566 if IECPath not in self.IECdebug_datas: |
1570 return |
1567 return |
1571 |
|
1572 |
1568 |
1573 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1569 # If no entry exist, create a new one with a fresh WeakKeyDictionary |
1574 IECdebug_data = self.IECdebug_datas.get(IECPath, None) |
1570 IECdebug_data = self.IECdebug_datas.get(IECPath, None) |
1575 IECdebug_data[2] = "Registered" |
1571 IECdebug_data[2] = "Registered" |
1576 IECdebug_data[3] = None |
1572 IECdebug_data[3] = None |
1577 |
|
1578 |
1573 |
1579 self.ReArmDebugRegisterTimer() |
1574 self.ReArmDebugRegisterTimer() |
1580 |
1575 |
1581 def CallWeakcallables(self, IECPath, function_name, *cargs): |
1576 def CallWeakcallables(self, IECPath, function_name, *cargs): |
1582 data_tuple = self.IECdebug_datas.get(IECPath, None) |
1577 data_tuple = self.IECdebug_datas.get(IECPath, None) |
1596 |
1591 |
1597 def RemoteExec(self, script, **kwargs): |
1592 def RemoteExec(self, script, **kwargs): |
1598 if self._connector is None: |
1593 if self._connector is None: |
1599 return -1, "No runtime connected!" |
1594 return -1, "No runtime connected!" |
1600 return self._connector.RemoteExec(script, **kwargs) |
1595 return self._connector.RemoteExec(script, **kwargs) |
1601 |
|
1602 |
1596 |
1603 def DispatchDebugValuesProc(self, event): |
1597 def DispatchDebugValuesProc(self, event): |
1604 debug_ticks, buffers = self.SnapshotAndResetDebugValuesBuffers() |
1598 debug_ticks, buffers = self.SnapshotAndResetDebugValuesBuffers() |
1605 start_time = time.time() |
1599 start_time = time.time() |
1606 if len(self.TracedIECPath) == len(buffers): |
1600 if len(self.TracedIECPath) == len(buffers): |