pykd
1"""PyKd test heplers/wrappers"""
2
3import pykd
4
5class ContextCallIt:
6"""Context manager/with statement"""
7def __init__(self, callIt):
8self.callIt = callIt
9
10def __enter__(self):
11return self
12
13def __exit__(self, exc_type, exc_value, exc_tb):
14try: self.callIt()
15except: pass
16
17class KillProcess:
18"""Kill process"""
19def __init__(self, processId):
20self.processId = processId
21
22def __call__(self):
23pykd.killProcess( self.processId )
24pykd.detachProcess( self.processId )
25
26def infGo():
27"""Infinite pykd.go call"""
28while True:
29pykd.go()
30
31