[matplotlib-devel] Selecting WX2.8 in examples

2009-03-06 Thread Sandro Tosi
Hello,
we are facing a problem in Debian where a user has problems running
embedding_in_wx*.py examples.

The problem is:

>>> from wx import *
Traceback (most recent call last):
  File "", line 1, in 
AttributeError: 'module' object has no attribute '__DocFilter'
>>> import wx
>>> print wx.__version__
2.6.3.2

Since WX2.8 is the one to use, the solution is simple:

>>> import wxversion
>>> wxversion.select('2.8')
>>> from wx import *
>>> wx.__version__
'2.8.7.1'

That solves the problem of multi-wx on a system.

What do you think about adding those 2 line into wx examples?

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Selecting WX2.8 in examples

2009-03-06 Thread Sandro Tosi
On Fri, Mar 6, 2009 at 22:12, Sandro Tosi  wrote:
 import wxversion
 wxversion.select('2.8')
 from wx import *
 wx.__version__
> '2.8.7.1'
>
> That solves the problem of multi-wx on a system.
>
> What do you think about adding those 2 line into wx examples?

Moreover, I will provide a patch to move from

>>> from wx import *

to

>>> import wx

that's much more clear. Just let me know if in the patch I will add
the wxversion.select or no.

Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Selecting WX2.8 in examples

2009-03-06 Thread Eric Firing
Sandro Tosi wrote:
> On Fri, Mar 6, 2009 at 22:12, Sandro Tosi  wrote:
> import wxversion
> wxversion.select('2.8')
> from wx import *
> wx.__version__
>> '2.8.7.1'
>>
>> That solves the problem of multi-wx on a system.
>>
>> What do you think about adding those 2 line into wx examples?
> 
> Moreover, I will provide a patch to move from
> 
 from wx import *
> 
> to
> 
 import wx
> 
> that's much more clear. Just let me know if in the patch I will add
> the wxversion.select or no.
> 
> Regards,

Sounds good to me, but I am not a wx user, so I might be missing 
something.  The only reservation that occurs to me is this:  suppose 
version 2.10 comes out, and someone has only that installed.  Is there a 
way to select 2.8 or higher, instead of requiring 2.8?

Eric


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Selecting WX2.8 in examples

2009-03-06 Thread Sandro Tosi
On Fri, Mar 6, 2009 at 23:00, Eric Firing  wrote:
> Sandro Tosi wrote:
>>
>> On Fri, Mar 6, 2009 at 22:12, Sandro Tosi  wrote:
>>
>> import wxversion
>> wxversion.select('2.8')
>> from wx import *
>> wx.__version__
>>>
>>> '2.8.7.1'
>>>
>>> That solves the problem of multi-wx on a system.
>>>
>>> What do you think about adding those 2 line into wx examples?
>>
>> Moreover, I will provide a patch to move from
>>
> from wx import *
>>
>> to
>>
> import wx
>>
>> that's much more clear. Just let me know if in the patch I will add
>> the wxversion.select or no.
>>
>> Regards,
>
> Sounds good to me, but I am not a wx user, so I might be missing something.
>  The only reservation that occurs to me is this:  suppose version 2.10 comes
> out, and someone has only that installed.  Is there a way to select 2.8 or
> higher, instead of requiring 2.8?

AFAIUI, it's not possible to say "2.8+" == "2.8 and all the higher
versions", but we can specify a list of version to be searched, the
first match is the one "mapped" as default wx. If no-one of the
specified version are available, then an exception is thrown:

>>> import wxversion
>>> wxversion.select(['2.5','2.3','2.9'])
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.5/site-packages/wxversion.py", line 149, in select
raise VersionError("Requested version of wxPython not found")
wxversion.VersionError: Requested version of wxPython not found
>>> wxversion.select(['2.5','2.3','2.8'])
>>> import wx
>>> wx.__version__
'2.8.7.1'

In any case, the example code doesn't work with wx2.6 so, as even a
temporary workaround, I think we should enforce the needs for wx2.8.

Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel