62 del sys.modules[self.threadModName] |
62 del sys.modules[self.threadModName] |
63 del sys.modules['threading'] |
63 del sys.modules['threading'] |
64 |
64 |
65 sys.meta_path.insert(0, self) |
65 sys.meta_path.insert(0, self) |
66 |
66 |
67 def attachThread(self, target=None, args=None, kwargs={}, |
67 def attachThread(self, target=None, args=None, kwargs=None, |
68 mainThread=False): |
68 mainThread=False): |
69 """ |
69 """ |
70 Public method to setup a standard thread for DebugClient to debug. |
70 Public method to setup a standard thread for DebugClient to debug. |
71 |
71 |
72 If mainThread is True, then we are attaching to the already |
72 If mainThread is True, then we are attaching to the already |
78 @param kwargs keyword arguments to pass to target |
78 @param kwargs keyword arguments to pass to target |
79 @param mainThread True, if we are attaching to the already |
79 @param mainThread True, if we are attaching to the already |
80 started mainthread of the app |
80 started mainthread of the app |
81 @return identifier of the created thread |
81 @return identifier of the created thread |
82 """ |
82 """ |
|
83 if kwargs is None: |
|
84 kwargs = {} |
|
85 |
83 if mainThread: |
86 if mainThread: |
84 ident = _thread.get_ident() |
87 ident = _thread.get_ident() |
85 name = 'MainThread' |
88 name = 'MainThread' |
86 newThread = self.mainThread |
89 newThread = self.mainThread |
87 newThread.isMainThread = True |
90 newThread.isMainThread = True |