Skip to content

Commit

Permalink
for #720... do not instantiate flow for C components!
Browse files Browse the repository at this point in the history
  • Loading branch information
petersilva committed Jul 25, 2023
1 parent b27fc09 commit a253e99
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
4 changes: 3 additions & 1 deletion sarracenia/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1705,7 +1705,9 @@ def finalize(self, component=None, config=None):
if hasattr(self, 'post_exchangeSuffix'):
self.post_exchange += '_%s' % self.post_exchangeSuffix

if hasattr(self, 'post_exchangeSplit') and self.post_exchangeSplit > 1:
if hasattr(self,'post_exchange') and (type(self.post_exchange) is list ):
pass
elif hasattr(self, 'post_exchangeSplit') and self.post_exchangeSplit > 1:
l = []
for i in range(0, int(self.post_exchangeSplit)):
y = self.post_exchange + '%02d' % i
Expand Down
4 changes: 1 addition & 3 deletions sarracenia/moth/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,8 @@ def __init__(self, options, is_subscriber):
self.rx_msg[3]=[]
self.rx_msg[4]=[]
self.rx_msg_mutex.release()
self.__getSetup()
else:
self.__putSetup()


logger.warning("note: mqtt support is newish, not very well tested")

def __sub_on_disconnect(client, userdata, rc, properties=None):
Expand Down
15 changes: 10 additions & 5 deletions sarracenia/sr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1653,11 +1653,16 @@ def config_show(self):
o = self.configs[c][cfg]['options']
o.no=0
o.finalize()
flow = sarracenia.flow.Flow.factory(o)
flow.loadCallbacks()
print('\nConfig of %s/%s: ' % (c, cfg))
flow.o.dump()
del flow
if c not in [ 'cpost', 'cpump' ]:
flow = sarracenia.flow.Flow.factory(o)
flow.loadCallbacks()
print('\nConfig of %s/%s: (with callbacks)' % (c, cfg))
flow.o.dump()
del flow
flow=None
else:
print('\nConfig of %s/%s: ' % (c, cfg))
o.dump()

def remove(self):

Expand Down

0 comments on commit a253e99

Please sign in to comment.