wx.lib.agw.persistance

Hi,

I am using above a lot and currently do not set ``PM_PERSIST_CONTROL_VALUE`` as the values are coming from the database, however I do have e.g. some checkbox controls which I like to persist.

Anyone has a nice idea on how I could have the above style on a particular control and not on the whole manager?

Werner

Actually, it’s wx.lib.agw.persist.

Interesting thing though, when I tryed to import wx.lib.agw.persist in the Python shell, I ran into the exception ImportError: No module named ‘UserDict’.

Let me note that the exception was triggered on the 64-bit Windows 7 Service Pack 1 running 64-bit Python 3.3.4 and on top of that wxPython Phoenix dev75969 (build date 22-Feb-2014, so the latest build) was used. Any clue why the exception was triggered?

Lots of work is still needed in wx.lib.xxxxxxxx to make it
compatible with Py 3.x
Werner

···

On 22/02/2014 18:31, Boštjan Mejak
wrote:

Actually, it’s wx.lib.agw.persist.

Interesting thing though, when I tryed to ** import
wx.lib.agw.persist** in the Python shell, I ran into the
exception ImportError: No module named ‘UserDict’.

      Let me note that the exception was triggered

on the 64-bit Windows 7 Service Pack 1 running 64-bit Python
3.3.4 and on top of that wxPython Phoenix dev75969 (build date
22-Feb-2014, so the latest build) was used. Any clue why the
exception was triggered?

Hi all and Andrea;-) ,

persistAllowIndivControlToSaveValue.patch (1.08 KB)

···

On 22/02/2014 15:55, Werner wrote:

Hi,

I am using above a lot and currently do not set ``PM_PERSIST_CONTROL_VALUE`` as the values are coming from the database, however I do have e.g. some checkbox controls which I like to persist.

Anyone has a nice idea on how I could have the above style on a particular control and not on the whole manager?

I had another look at this and came up with the following patch, would that be acceptable?

If yes, where would be a good place within the persist package to document this?

Werner

Werner, I have examined your patch. Instead of the two occurences elif obj._window._persistValue == True: you can just simply write elif obj._window._persistValue: (ommiting the == True part).

Thanks
Werner

···

On 25/02/2014 10:38, Boštjan Mejak
wrote:

      Werner, I have examined your patch. Instead of

the two occurences elif obj._window._persistValue == True: you
can just simply write elif obj._window._persistValue: (ommiting
the == True part).

Hi,

Here an updated patch with documentation added where I thought it might make sense, also removed the '_' from the variable name as it should not be private.

Werner

persistAllowIndivControlToSaveValue2.patch (2.93 KB)

Reviewed your patch again. You’ve done a great job! The patch looks superb.

Werner wrote:

···

On 22/02/2014 18:31, Boštjan Mejak wrote:

Actually, it's *wx.lib.agw.persist*.

Interesting thing though, when I tryed to *import
wx.lib.agw.persist* in the Python shell, I ran into the exception
*ImportError: No module named 'UserDict'*.

Let me note that the exception was triggered on the 64-bit Windows 7
Service Pack 1 running 64-bit Python 3.3.4 and on top of that wxPython
Phoenix dev75969 (build date 22-Feb-2014, so the latest build) was
used. Any clue why the exception was triggered?

Lots of work is still needed in wx.lib.xxxxxxxx to make it compatible
with Py 3.x

Specifically in this case, Common migration problems — Supporting Python 3: An in-depth guide

--
Robin Dunn
Software Craftsman

What about the six module? Does it provide any UserDict <==> collections.UserDict compatibility?

Hi Werner,

Sorry for the late reply. The patch looks good to me and it can certainly be applied as it is. One of the problem I have in doing it myself is that my laptop broke down a week ago and now I’m down to the ipad, so no SVN or testing of wxPython stuff for me…

Maybe Robin or some other wx-dev can apply your patch to AGW?

It may be some time before I get a new laptop as it appears that in Denmark it is impossible to get a laptop with a US or UK keyboard, and to be honest I don’t feel inclined to code when my keyboard is full of “ø”, “å” and “æ” stuff… Almost as fun as the Italian keyboard, I would say :slight_smile:

Andrea.

···

On Tuesday, February 25, 2014, Werner wernerfbd@gmx.ch wrote:

Hi,

Here an updated patch with documentation added where I thought it might make sense, also removed the ‘_’ from the variable name as it should not be private.

Werner

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Andrea Gavana wrote:

It may be some time before I get a new laptop as it appears that in
Denmark it is impossible to get a laptop with a US or UK keyboard, and
to be honest I don't feel inclined to code when my keyboard is full of
"ø", "å" and "æ" stuff... Almost as fun as the Italian keyboard, I
would say :slight_smile:

On a recent client visit, they gave me a machine with a German keyboard
that used a US keyboard mapping. I'm a good enough touch typist that I
could ignore the Y/Z swap, but it was a real pain trying to find the {
curly braces } and the backslash \.

···

--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

Andrea, you’re in Denmark now? I thought you’re in Greece. I read about your awful experience with the moving company (can’t remember its name) a few years back. I read on LinkedIn how successful you are. I’m very happy for you! :slight_smile:

Sounds like you should just create a Pull REQz on github and send it to Robin as with the other stuff we’ve been doing, since Andrea can’t upload ATM.
That would be the easiest. Just stick it on the list so it doesn’t get forgotten.

···

On Tuesday, February 25, 2014 4:13:24 AM UTC-6, werner wrote:

Hi,

Here an updated patch with documentation added where I thought it might
make sense, also removed the ‘_’ from the variable name as it should not
be private.

Werner

Hi Andrea,

Hi Werner,

Sorry for the late reply. The patch looks good to me and it can certainly be applied as it is.

Great, no urgency for me to have it applied.

One of the problem I have in doing it myself is that my laptop broke down a week ago and now I'm down to the ipad, so no SVN or testing of wxPython stuff for me...

Maybe Robin or some other wx-dev can apply your patch to AGW?

That would be great, should I do a pull request for Phoenix or will this one do?

It may be some time before I get a new laptop as it appears that in Denmark it is impossible to get a laptop with a US or UK keyboard, and to be honest I don't feel inclined to code when my keyboard is full of "ø", "å" and "æ" stuff... Almost as fun as the Italian keyboard, I would say :slight_smile:

In the past I ordered PC's from Dell and they offered the option to have a UK or US keyboard.

Currently I use a Sony with a French keyboard but I have it reconfigured in Windows as a US keyboard - maybe that is an option.

Werner

···

On 27/02/2014 20:48, Andrea Gavana wrote:

...

Currently I use a Sony with a French keyboard but I have it reconfigured in Windows as a US keyboard - maybe that is an option.

BTW, this is configured in the "Region and Language" control panel.

Werner

···

On 28/02/2014 08:58, Werner wrote:

Boštjan Mejak wrote:

What about the six module? Does it provide any UserDict <==>
collections.UserDict compatibility?

It doesn't. I suspect it is because of the differences in implementation described at that link, so it's not just a matter of the same class being moved to a different module.

···

--
Robin Dunn
Software Craftsman

The following lines of code solve our problem:

try:

import UserDict

except ImportError:

from collections import UserDict

Please change every import UserDict occurence in wxPython Phoenix source code with my solution above. All we need is to fix the importing part of the code and we’re golden. Robin, can you address this?