(Should I) Update pubsub?

Hi! So, looking for a pubsub tutorial, I found http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/, where I read “The newest pubsub has a slightly different API which you can check out in its cookbook.” I followed the link and read "Get the version of pubsub used by your application: start a python interpreter session; copy your app’s pubsub import statement; for instance

from wx.lib.pubsub import pub

If the printout starts with “1” [mine is 1.1.200904.r159]…Do the following:

  1. add a from wx.lib.pubsub import setupv1 in your application’s
    startup script, before the first pubsub import
  2. confirm that all works well…" etc., etc.
    The 1.1.200904 result was obtained typing from wx.lib.pubsub import pub at the shell prompt in SPE; if I launch a separate session and type simply import pubsub, I get No module named pubsub–clearly the pubsub I have is tied to my wxpython install, and it’s a V1 edition. However, in the (wx) app I’m writing, i.e., the one in which I want to use pubsub, I haven’t yet actually started using it, so I’d just as soon start using V3 from the outset. A) Can I do this using wxpython 2.8.11.0 (i.e., are there incompatibilities between that version of wxpython and pubsub3)? B) If yes, how do I install pubsubV3 and configure my wx app so that V3 is found and used instead of the V1 that came w/ my 2.8.11.0 wxpython edition)?

Thanks for the help.

Hi David,

Hi!� So, looking for a pubsub tutorial, I found http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/ ,
where I read "The newest pubsub has a slightly different API which
you can check out in its cookbook ."� I followed the link and read
"Get the version of pubsub used by your application: start a
python interpreter session; copy your app�s pubsub import
statement; for instance

from wx.lib.pubsub import pub
  If the printout starts with �1� [mine is 1.1.200904.r159]...Do the

following:

  1. add a from wx.lib.pubsub import setupv1 in your application�s
    startup script, before the first pubsub import
  2. confirm that all works well…" etc., etc.
    The 1.1.200904 result was obtained typing from wx.lib.pubsub
    import pub at the shell prompt in SPE; if I launch a separate
    session and type simply import pubsub, I get No module named
    pubsub–clearly the pubsub I have is tied to my wxpython
    install, and it’s a V1 edition.� However, in the (wx) app I’m
    writing, i.e., the one in which I want to use pubsub, I haven’t
    yet actually started using it, so I’d just as soon start using
    V3 from the outset.� A) Can I do this using wxpython 2.8.11.0
    (i.e., are there incompatibilities between that version of
    wxpython and pubsub3)?� B) If yes, how do I install pubsubV3 and
    configure my wx app so that V3 is found and used instead of the
    V1 that came w/ my 2.8.11.0 wxpython edition)?
wxPython includes v3 of pupsub, just import it like this to activate

v3.

import wx.lib.pubsub.setupkwargs

from wx.lib.pubsub import pub

However the latest in wxPython 2.9.3 and trunk from pubsub contains

some enhancements which I don’t think made it into the 2.8.11.

Normally topic names are strings, in the latest version if you

define the topics like this:

class statusText:

��� """a status text needs to be shown

���

��� :param msg: the msg to be shown

��� :param flag: wx.ICON_something, it is assumed that the listing

handler

������� will default to wx.ICON_INFORMATION, depending on where the

statusText

������� is shown it could also ignore this flag (e.g. when using

wx.StatusText)

��� """

��� def msgDataSpec(msg, flag=None):

������� """params doc defined on class above"""

You can use it like this:

pub.subscribe(listenerTest3, pTopics.statusText)

or the old way:

pub.subscribe(listenerTest3, "pTopics.statusText")

The first one is very nice as in a lot of IDE's you get code

completion on it.

If it didn't make it into 2.8.11 I guess you could also get it from

a 2.9.3 install or from SVN or from pubsub site and put it into
wx.lib.pubsub.

Werner
···

On 21/03/2012 22:12, David Goldsmith wrote:

Thanks, Werner, that did the trick!

DG

···

On Thu, Mar 22, 2012 at 12:37 AM, werner wbruhin@free.fr wrote:

Hi David,

On 21/03/2012 22:12, David Goldsmith wrote:

Hi! So, looking for a pubsub tutorial, I found http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/ ,
where I read “The newest pubsub has a slightly different API which
you can check out in its cookbook .” I followed the link and read
"Get the version of pubsub used by your application: start a
python interpreter session; copy your app’s pubsub import
statement; for instance

from wx.lib.pubsub import pub
  If the printout starts with “1” [mine is 1.1.200904.r159]...Do the

following:

  1. add a from wx.lib.pubsub import setupv1 in your application’s
    startup script, before the first pubsub import
  2. confirm that all works well…" etc., etc.
    The 1.1.200904 result was obtained typing from wx.lib.pubsub
    import pub at the shell prompt in SPE; if I launch a separate
    session and type simply import pubsub, I get No module named
    pubsub–clearly the pubsub I have is tied to my wxpython
    install, and it’s a V1 edition. However, in the (wx) app I’m
    writing, i.e., the one in which I want to use pubsub, I haven’t
    yet actually started using it, so I’d just as soon start using
    V3 from the outset. A) Can I do this using wxpython 2.8.11.0
    (i.e., are there incompatibilities between that version of
    wxpython and pubsub3)? B) If yes, how do I install pubsubV3 and
    configure my wx app so that V3 is found and used instead of the
    V1 that came w/ my 2.8.11.0 wxpython edition)?
wxPython includes v3 of pupsub, just import it like this to activate

v3.

import wx.lib.pubsub.setupkwargs

from wx.lib.pubsub import pub



However the latest in wxPython 2.9.3 and trunk from pubsub contains

some enhancements which I don’t think made it into the 2.8.11.

Normally topic names are strings, in the latest version if you

define the topics like this:

class statusText:

    """a status text needs to be shown

   

    :param msg: the msg to be shown

    :param flag: wx.ICON_something, it is assumed that the listing

handler

        will default to wx.ICON_INFORMATION, depending on where the

statusText

        is shown it could also ignore this flag (e.g. when using

wx.StatusText)

    """



    def msgDataSpec(msg, flag=None):

        """params doc defined on class above"""





You can use it like this:



pub.subscribe(listenerTest3, pTopics.statusText)



or the old way:



pub.subscribe(listenerTest3, "pTopics.statusText")



The first one is very nice as in a lot of IDE's you get code

completion on it.

If it didn't make it into 2.8.11 I guess you could also get it from

a 2.9.3 install or from SVN or from pubsub site and put it into
wx.lib.pubsub.

Werner

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Note my address change and please update your address books. Thanks!

I want to thank the users of pubsub who chip in with answers, I am too busy I don’t know if I still have a head, much appreciated.

Oliver

(maintainer of pubsub)

···

On Thu, Mar 22, 2012 at 3:37 AM, werner wbruhin@free.fr wrote:

Hi David,

On 21/03/2012 22:12, David Goldsmith wrote:

Hi! So, looking for a pubsub tutorial, I found http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/ ,
where I read “The newest pubsub has a slightly different API which
you can check out in its cookbook .” I followed the link and read
"Get the version of pubsub used by your application: start a
python interpreter session; copy your app’s pubsub import
statement; for instance

from wx.lib.pubsub import pub
  If the printout starts with “1” [mine is 1.1.200904.r159]...Do the

following:

  1. add a from wx.lib.pubsub import setupv1 in your application’s
    startup script, before the first pubsub import
  2. confirm that all works well…" etc., etc.
    The 1.1.200904 result was obtained typing from wx.lib.pubsub
    import pub at the shell prompt in SPE; if I launch a separate
    session and type simply import pubsub, I get No module named
    pubsub–clearly the pubsub I have is tied to my wxpython
    install, and it’s a V1 edition. However, in the (wx) app I’m
    writing, i.e., the one in which I want to use pubsub, I haven’t
    yet actually started using it, so I’d just as soon start using
    V3 from the outset. A) Can I do this using wxpython 2.8.11.0
    (i.e., are there incompatibilities between that version of
    wxpython and pubsub3)? B) If yes, how do I install pubsubV3 and
    configure my wx app so that V3 is found and used instead of the
    V1 that came w/ my 2.8.11.0 wxpython edition)?
wxPython includes v3 of pupsub, just import it like this to activate

v3.

import wx.lib.pubsub.setupkwargs

from wx.lib.pubsub import pub



However the latest in wxPython 2.9.3 and trunk from pubsub contains

some enhancements which I don’t think made it into the 2.8.11.

Normally topic names are strings, in the latest version if you

define the topics like this:

class statusText:

    """a status text needs to be shown

   

    :param msg: the msg to be shown

    :param flag: wx.ICON_something, it is assumed that the listing

handler

        will default to wx.ICON_INFORMATION, depending on where the

statusText

        is shown it could also ignore this flag (e.g. when using

wx.StatusText)

    """



    def msgDataSpec(msg, flag=None):

        """params doc defined on class above"""





You can use it like this:



pub.subscribe(listenerTest3, pTopics.statusText)



or the old way:



pub.subscribe(listenerTest3, "pTopics.statusText")



The first one is very nice as in a lot of IDE's you get code

completion on it.

If it didn't make it into 2.8.11 I guess you could also get it from

a 2.9.3 install or from SVN or from pubsub site and put it into
wx.lib.pubsub.

Werner

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

BTW please take a look at the docs on the site at pubsub.sourceforge.net. One user said recently "
“Architecture and Design Guidelines” and “Example Development Process” sub-sections, to be the most helpful general discussion for “thinking pubsub” ". Those are not obvious right now from the TOC of the site.

Oliver

···

On Fri, Mar 23, 2012 at 10:30 AM, oliver oliver.schoenborn@gmail.com wrote:

On Thu, Mar 22, 2012 at 3:37 AM, werner wbruhin@free.fr wrote:

Hi David,

On 21/03/2012 22:12, David Goldsmith wrote:

Hi! So, looking for a pubsub tutorial, I found http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/ ,
where I read “The newest pubsub has a slightly different API which
you can check out in its cookbook .” I followed the link and read
"Get the version of pubsub used by your application: start a
python interpreter session; copy your app’s pubsub import
statement; for instance

from wx.lib.pubsub import pub
  If the printout starts with “1” [mine is 1.1.200904.r159]...Do the

following:

  1. add a from wx.lib.pubsub import setupv1 in your application’s
    startup script, before the first pubsub import
  2. confirm that all works well…" etc., etc.
    The 1.1.200904 result was obtained typing from wx.lib.pubsub
    import pub at the shell prompt in SPE; if I launch a separate
    session and type simply import pubsub, I get No module named
    pubsub–clearly the pubsub I have is tied to my wxpython
    install, and it’s a V1 edition. However, in the (wx) app I’m
    writing, i.e., the one in which I want to use pubsub, I haven’t
    yet actually started using it, so I’d just as soon start using
    V3 from the outset. A) Can I do this using wxpython 2.8.11.0
    (i.e., are there incompatibilities between that version of
    wxpython and pubsub3)? B) If yes, how do I install pubsubV3 and
    configure my wx app so that V3 is found and used instead of the
    V1 that came w/ my 2.8.11.0 wxpython edition)?
wxPython includes v3 of pupsub, just import it like this to activate

v3.

import wx.lib.pubsub.setupkwargs

from wx.lib.pubsub import pub



However the latest in wxPython 2.9.3 and trunk from pubsub contains

some enhancements which I don’t think made it into the 2.8.11.

Normally topic names are strings, in the latest version if you

define the topics like this:

class statusText:

    """a status text needs to be shown

   

    :param msg: the msg to be shown

    :param flag: wx.ICON_something, it is assumed that the listing

handler

        will default to wx.ICON_INFORMATION, depending on where the

statusText

        is shown it could also ignore this flag (e.g. when using

wx.StatusText)

    """



    def msgDataSpec(msg, flag=None):

        """params doc defined on class above"""





You can use it like this:



pub.subscribe(listenerTest3, pTopics.statusText)



or the old way:



pub.subscribe(listenerTest3, "pTopics.statusText")



The first one is very nice as in a lot of IDE's you get code

completion on it.

If it didn't make it into 2.8.11 I guess you could also get it from

a 2.9.3 install or from SVN or from pubsub site and put it into
wx.lib.pubsub.

Werner

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I want to thank the users of pubsub who chip in with answers, I am too busy I don’t know if I still have a head, much appreciated.

Oliver

(maintainer of pubsub)

That was me. :slight_smile:

···

On Fri, Mar 23, 2012 at 7:43 AM, oliver oliver.schoenborn@gmail.com wrote:

BTW please take a look at the docs on the site at pubsub.sourceforge.net. One user said recently "
“Architecture and Design Guidelines” and “Example Development Process” sub-sections, to be the most helpful general discussion for “thinking pubsub” ". Those are not obvious right now from the TOC of the site.

Oliver

On Fri, Mar 23, 2012 at 10:30 AM, oliver oliver.schoenborn@gmail.com wrote:

On Thu, Mar 22, 2012 at 3:37 AM, werner wbruhin@free.fr wrote:

Hi David,

On 21/03/2012 22:12, David Goldsmith wrote:

Hi! So, looking for a pubsub tutorial, I found http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/ ,
where I read “The newest pubsub has a slightly different API which
you can check out in its cookbook .” I followed the link and read
"Get the version of pubsub used by your application: start a
python interpreter session; copy your app’s pubsub import
statement; for instance

from wx.lib.pubsub import pub
  If the printout starts with “1” [mine is 1.1.200904.r159]...Do the

following:

  1. add a from wx.lib.pubsub import setupv1 in your application’s
    startup script, before the first pubsub import
  2. confirm that all works well…" etc., etc.
    The 1.1.200904 result was obtained typing from wx.lib.pubsub
    import pub at the shell prompt in SPE; if I launch a separate
    session and type simply import pubsub, I get No module named
    pubsub–clearly the pubsub I have is tied to my wxpython
    install, and it’s a V1 edition. However, in the (wx) app I’m
    writing, i.e., the one in which I want to use pubsub, I haven’t
    yet actually started using it, so I’d just as soon start using
    V3 from the outset. A) Can I do this using wxpython 2.8.11.0
    (i.e., are there incompatibilities between that version of
    wxpython and pubsub3)? B) If yes, how do I install pubsubV3 and
    configure my wx app so that V3 is found and used instead of the
    V1 that came w/ my 2.8.11.0 wxpython edition)?
wxPython includes v3 of pupsub, just import it like this to activate

v3.

import wx.lib.pubsub.setupkwargs

from wx.lib.pubsub import pub



However the latest in wxPython 2.9.3 and trunk from pubsub contains

some enhancements which I don’t think made it into the 2.8.11.

Normally topic names are strings, in the latest version if you

define the topics like this:

class statusText:

    """a status text needs to be shown

   

    :param msg: the msg to be shown

    :param flag: wx.ICON_something, it is assumed that the listing

handler

        will default to wx.ICON_INFORMATION, depending on where the

statusText

        is shown it could also ignore this flag (e.g. when using

wx.StatusText)

    """



    def msgDataSpec(msg, flag=None):

        """params doc defined on class above"""





You can use it like this:



pub.subscribe(listenerTest3, pTopics.statusText)



or the old way:



pub.subscribe(listenerTest3, "pTopics.statusText")



The first one is very nice as in a lot of IDE's you get code

completion on it.

If it didn't make it into 2.8.11 I guess you could also get it from

a 2.9.3 install or from SVN or from pubsub site and put it into
wx.lib.pubsub.

Werner

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

I want to thank the users of pubsub who chip in with answers, I am too busy I don’t know if I still have a head, much appreciated.

Oliver

(maintainer of pubsub)

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en


Note my address change and please update your address books. Thanks!

BTW please take a look at the docs on the site at pubsub.sourceforge.net. One user said recently " “Architecture and Design Guidelines” and “Example Development Process” sub-sections, to be the most helpful general discussion for “thinking pubsub” ". Those are not obvious right now from the TOC of the site.

Oliver

That was me. :slight_smile:

LOL, you see, feedback from end-users does not fall on deaf ears :stuck_out_tongue:

···

On Fri, Mar 23, 2012 at 7:43 AM, oliver oliver.schoenborn@gmail.com wrote:
On Fri, Mar 23, 2012 at 11:42 AM, David Goldsmith eulergaussriemann@gmail.com wrote:

On Fri, Mar 23, 2012 at 7:43 AM, oliver oliver.schoenborn@gmail.com wrote:

BTW please take a look at the docs on the site at pubsub.sourceforge.net. One user said recently "
“Architecture and Design Guidelines” and “Example Development Process” sub-sections, to be the most helpful general discussion for “thinking pubsub” ". Those are not obvious right now from the TOC of the site.

Oliver

On Fri, Mar 23, 2012 at 10:30 AM, oliver oliver.schoenborn@gmail.com wrote:

On Thu, Mar 22, 2012 at 3:37 AM, werner wbruhin@free.fr wrote:

Hi David,

On 21/03/2012 22:12, David Goldsmith wrote:

Hi! So, looking for a pubsub tutorial, I found http://www.blog.pythonlibrary.org/2010/06/27/wxpython-and-pubsub-a-simple-tutorial/ ,
where I read “The newest pubsub has a slightly different API which
you can check out in its cookbook .” I followed the link and read
"Get the version of pubsub used by your application: start a
python interpreter session; copy your app’s pubsub import
statement; for instance

from wx.lib.pubsub import pub
  If the printout starts with “1” [mine is 1.1.200904.r159]...Do the

following:

  1. add a from wx.lib.pubsub import setupv1 in your application’s
    startup script, before the first pubsub import
  2. confirm that all works well…" etc., etc.
    The 1.1.200904 result was obtained typing from wx.lib.pubsub
    import pub at the shell prompt in SPE; if I launch a separate
    session and type simply import pubsub, I get No module named
    pubsub–clearly the pubsub I have is tied to my wxpython
    install, and it’s a V1 edition. However, in the (wx) app I’m
    writing, i.e., the one in which I want to use pubsub, I haven’t
    yet actually started using it, so I’d just as soon start using
    V3 from the outset. A) Can I do this using wxpython 2.8.11.0
    (i.e., are there incompatibilities between that version of
    wxpython and pubsub3)? B) If yes, how do I install pubsubV3 and
    configure my wx app so that V3 is found and used instead of the
    V1 that came w/ my 2.8.11.0 wxpython edition)?