7
7
import weakref
8
8
from copy import copy
9
9
10
- try :
11
- if os .environ ['IPS_TIMING' ] == '1' :
12
- try :
13
- import pytau
14
- except ImportError :
15
- raise
16
- IPS_TIMING = True
17
- except KeyError :
18
- pass
19
-
20
10
21
11
class Component :
22
12
"""
@@ -28,9 +18,6 @@ def __init__(self, services, config):
28
18
"""
29
19
Set up config values and reference to services.
30
20
"""
31
- # pytau.setNode(1)
32
- # timer = pytau.profileTimer("component.__init__", "", str(os.getpid()))
33
- # pytau.start(timer)
34
21
self .component_id = None
35
22
self .invocation_q = None
36
23
self .services = weakref .proxy (services )
@@ -42,11 +29,8 @@ def __init__(self, services, config):
42
29
setattr (self , i , config [i ])
43
30
except Exception as e :
44
31
print ('Error setting Component parameter : ' , i , ' - ' , e )
45
- # pytau.stop(timer)
46
32
raise
47
33
48
- # pytau.stop(timer)
49
-
50
34
def __copy__ (self ):
51
35
cls = self .__class__
52
36
result = cls .__new__ (cls )
@@ -61,16 +45,11 @@ def __initialize__(self, component_id, invocation_q, start_time=0.0):
61
45
"""
62
46
Establish connection to *invocation_q*.
63
47
"""
64
- # timer = pytau.profileTimer("component.__initialize__", "", str(os.getpid()))
65
- # pytau.start(timer)
66
48
self .component_id = component_id
67
49
self .invocation_q = invocation_q
68
50
self .start_time = start_time
69
51
# setattr(sys, 'exit', sys.exit)
70
52
71
- # pytau.stop(timer)
72
- return
73
-
74
53
def __my_exit__ (self , arg = 0 ):
75
54
"""
76
55
Produce message and exception about exit.
@@ -86,8 +65,6 @@ def __run__(self):
86
65
Wait for incoming commands delivered via the *invocation_q*, and
87
66
dispatch the incoming methods accordingly.
88
67
"""
89
- # timer = pytau.profileTimer(self.component_id.__str__() + ".__run__", "", str(os.getpid()))
90
- # pytau.start(timer)
91
68
92
69
tmp = sys .exit
93
70
sys .exit = self .__my_exit__
@@ -131,7 +108,6 @@ def __run__(self):
131
108
(errno , strerror ) = oserr .args
132
109
self .services .exception ('Error creating directory %s : %s' ,
133
110
workdir , strerror )
134
- # pytau.stop(timer)
135
111
raise
136
112
os .chdir (workdir )
137
113
self .services .debug ('Running - CompID = %s' ,
@@ -140,9 +116,6 @@ def __run__(self):
140
116
if (self .services .profile ):
141
117
self .services .debug ('Instrumenting - CompID = %s' ,
142
118
self .component_id .get_serialization ())
143
- pytau .setNode (int (self .component_id .get_seq_num ()))
144
- pytau .dbPurge ()
145
- self .services ._make_timers ()
146
119
self .services ._init_event_service ()
147
120
148
121
while True :
@@ -175,7 +148,6 @@ def __run__(self):
175
148
call_id ,
176
149
Message .SUCCESS , retval )
177
150
self .services .fwk_in_q .put (response_msg )
178
- # pytau.stop(timer)
179
151
180
152
def init (self , timestamp = 0.0 , ** keywords ):
181
153
"""
@@ -241,7 +213,6 @@ def terminate(self, status):
241
213
Clean up services and call :py:obj:`sys_exit`.
242
214
"""
243
215
# print self.services.full_comp_id, ": terminate() method called"
244
- self .services ._cleanup ()
245
216
# self.services.debug('###(1) %s %s', str(self), str(self.__dict__))
246
217
247
218
if (status == Message .SUCCESS ):
0 commit comments