Re: Trellis: Sensor.listening and iter_listeners()
"Sergey Schetinin" <[email protected]>
| Newsgroups | gmane.comp.python.peak |
|---|---|
| Message-ID | <[email protected]> |
After adding `if self.update_connection not in pending: on_undo(pending.remove, self.update_connection)` in relevant places, the printed counts show that all of them get called, so this has to be something else. On Wed, Nov 12, 2008 at 18:25, Sergey Schetinin <[email protected]> wrote: > I forgot to mention that the same debug prints were added to > LazyCell.run right after scheduling of update_connection. > > On Wed, Nov 12, 2008 at 18:19, Sergey Schetinin <[email protected]> wrote: >> I tracked this down to the fact that not all scheduled >> update_connection get called. >> >> In attempt to find out how often does this happen I added the >> following to SensorBase._set_listener (`pending` refers to a global >> set()) >> >> print len(pending), '++' >> pending.add(self) >> >> and in update_connection >> >> print len(pending), '--' >> pending.remove(self) >> >> And the printed counts don't go back to 1 even for tests that seem to >> work correctly. Am I missing something? >> >> >> >> >> On Wed, Nov 12, 2008 at 16:18, Sergey Schetinin <[email protected]> wrote: >>> I tracked one of the issues I was having periodically to a case when a >>> sensor did not connect when it should have. >>> >>>>>> evt_cell >>> Sensor(<bound method PyEventBinder._events of <wx._core.PyEventBinder >>> object at 0x00E5DD10>>, None, discrete[None]) >>>>>> evt_cell.listening >>> NOT_GIVEN >>>>>> list(evt_cell.iter_listeners()) >>> [WxCell(221), WxCell(392)] >>> >>> This state is invalid, correct? >>> >>> >>> -- >>> Best Regards, >>> Sergey Schetinin >>> >>> http://s3bk.com/ -- S3 Backup >>> http://word-to-html.com/ -- Word to HTML Converter >>> >> >> >> >> -- >> Best Regards, >> Sergey Schetinin >> >> http://s3bk.com/ -- S3 Backup >> http://word-to-html.com/ -- Word to HTML Converter >> > > > > -- > Best Regards, > Sergey Schetinin > > http://s3bk.com/ -- S3 Backup > http://word-to-html.com/ -- Word to HTML Converter > -- Best Regards, Sergey Schetinin http://s3bk.com/ -- S3 Backup http://word-to-html.com/ -- Word to HTML Converter