Fast support! I am falling in love with Dabo.
I am using Python 2.5.4 on Vista and Win7. I've tried to adhere to same
versions of Python software in
http://wiki.dabodev.com/InstallationOnWindows, but wxPython recommended
there is too old for dPageStyle in demo, so I upgraded to version 2.8.10.1.
My OS locale is Spain (Spain, Traditional).
Version info:
Platform: Win
Python Version: 2.5.4 on win32
Dabo Version: Version 0.9.3;
Revision ~6449
UI Version: 2.8.10.1 on wxMSW (---> wxPython2.8-win32-unicode-2.8.10.1-py25.exe)
I also downloaded the Dabo Runtime Engine: same problem, info is:
Platform: Win
Python Version: 2.5.2 on win32
Dabo Version: Version 0.9.3;
Revision ~6449
UI Version: 2.8.10.1 on wxMSW
(obviously I can't see the error, no stdout in demo)
Thank You, Ed. I'm afraid my email provider of 10 years (Terra) is finally drawing to an end. I coundn't reply to your post and I had to create a new one. I will create a new account at gmail soon, sorry for the inconvenience.
melkarth
--------------------------------------------------
From: "Ed Leafe" <ed@leafe.com>
Sent: Thursday, May 19, 2011 1:00 AM
To: <MELKARTH@terra.es>; "Dabo Users list" <dabo-users@leafe.com>
Subject: Re: [dabo-users] Problem in Dabo demo
> On May 18, 2011, at 6:21 PM, MELKARTH@terra.es wrote:
>
>> Hi! I'm a total novice to Dabo and (almost) to Python.
>
> Welcome to both Dabo and Python!
>
>> I'm looking for a new tool to make backend programs, I just to use high
>> level 4GL languages, like Progress or Windev.
>> I just started to read the PyCon tutorial and play with the demo. Looks
>> great!
>>
>> My question is simple. I have seen a difference between dTextBox and
>> dEditBox: dTextBox in the demo doesn't allow me to type accented vowels
>> in it (returns an error), while dEditBox works fine. The error is:
>>
>> File "C:\Projects\dabo\demo\samples/dTextBox.py", line 56, in
>> onTextKeyChar
>> cd, ch = evt.keyCode, evt.keyChar
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 0:
>> ordinal not in range(128)
>>
>> I am trying to localize my apps in spanish, so it's not a lot of change,
>> but the range of chars is 256.
>> In my Python novice code I always write this line: # -*- coding:
>> latin-1 -*- (I don't know if it helps).
>
> Hmmm.. I just tried entering some accented characters in the demo, and it
> worked fine in both dTextBox and dEditBox. Can you tell me your version
> information? You can get it by running the app, selecting the Help/About
> menu item, and then clicking the Copy button. You can then paste the info
> into your reply.
>
>> I'd like to know if this little problem is difficult to -fix? (It doesn't
>> seem to me, because dEditBox is ok !).
>
> It might already be fixed - we have a few non-USA people who have been a
> great help in moving our unicode support forward.
>
>> Thanks in advance, and excuse my bad english.
>
>
> Your English is fine!
>
>
>
> -- Ed Leafe
>
>
>
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/24729442.859161305802932157.JavaMail.defaultUser@defaultHost
On May 19, 2011, at 7:02 AM, MELKARTH@terra.es wrote:
> Version info:
> Platform: Win
> Python Version: 2.5.4 on win32
> Dabo Version: Version 0.9.3;
> Revision ~6449
> UI Version: 2.8.10.1 on wxMSW (---> wxPython2.8-win32-unicode-2.8.10.1-py25.exe)
Your versions look fine. I saw that you are using latin-1 encoding; the default for Dabo is utf-8. One thing to try is to create a file in the 'demo' directory named 'settings_override.py', and in it simply have the line
defaultEncoding = "latin-1"
This will, as the filename suggests, override the default setting for encoding and tell it to use latin-1 instead. See if that makes a difference.
-- Ed Leafe
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/F5990B62-8318-4121-A29C-E41B617D66D3@leafe.com
Ed, I hope we can have a coherent thread with my new mail address. I could not reply, so the conversation is fragmented right now.
I find no improvement with the new file 'settings_override.py' in demo folder.
As I said to Hraban, I have tested my programs with UTF-8 and they also worked ok, I will use this coding in them from now on, instead of latin-1.
I'm using an unicode wxPython, and dEditBox runs fine. I think it must be something inside dTextBox.
When I enter this lowercase letter: http://en.wikipedia.org/wiki/%C3%81 , I get:
File "C:\Python25\DABO\demo\samples/dTextBox.py", line 56, in onTextKeyChar
cd, ch = evt.keyCode, evt.keyChar
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position 0:
ordinal not in range(128)
By the way, I'm only using DaboDemo.py now, not mixing with other python
code.
melkarth
--------------------------------------------------
From: "Ed Leafe" <ed@leafe.com>
Sent: Thursday, May 19, 2011 2:09 PM
To: <MELKARTH@terra.es>; "Dabo Users list" <dabo-users@leafe.com>
Subject: Re: [dabo-users] Reenv: Problem in Dabo demo
> On May 19, 2011, at 7:02 AM, MELKARTH@terra.es wrote:
>
>> Version info:
>> Platform: Win
>> Python Version: 2.5.4 on win32
>> Dabo Version: Version 0.9.3;
>> Revision ~6449
>> UI Version: 2.8.10.1 on wxMSW (--->
>> wxPython2.8-win32-unicode-2.8.10.1-py25.exe)
>
>
> Your versions look fine. I saw that you are using latin-1 encoding; the
> default for Dabo is utf-8. One thing to try is to create a file in the
> 'demo' directory named 'settings_override.py', and in it simply have the
> line
>
> defaultEncoding = "latin-1"
>
> This will, as the filename suggests, override the default setting for
> encoding and tell it to use latin-1 instead. See if that makes a
> difference.
>
>
>
> -- Ed Leafe
>
>
>
--- StripMime Report -- processed MIME parts ---
multipart/alternative
text/plain (text body -- kept)
text/html
---
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4B4F5973604F4A8FB389461AA6220DCE@Informatica2
Author: Henning Hraban Ramm
Posted: 2011-05-20 01:58:16 Link
Am 2011-05-19 um 15:48 schrieb melkarth0:
> As I said to Hraban, I have tested my programs with UTF-8 and they
> also worked ok, I will use this coding in them from now on, instead
> of latin-1.
> I'm using an unicode wxPython, and dEditBox runs fine. I think it
> must be something inside dTextBox.
> When I enter this lowercase letter: http://en.wikipedia.org/wiki/%C3%81
> , I get:
>
> File "C:\Python25\DABO\demo\samples/dTextBox.py", line 56, in
> onTextKeyChar
> cd, ch = evt.keyCode, evt.keyChar
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position
> 0:
> ordinal not in range(128)
>
> By the way, I'm only using DaboDemo.py now, not mixing with other
> python
> code.
Ok, sorry I didn’t test yesterday - I can confirm the error in my
environment (latest SVN):
Platform: Mac
Python Version: 2.6.4 on darwin
Dabo Version: Version 0.9.3; Revision 6589M
UI Version: 2.8.11.0 on wxMac
Just making the strings in the handlers unicode (Melkart: enter a 'u'
in front of the quotes) fixes the problem.
Greetlings from Lake Constance!
Hraban
---
https://www.cacert.org (I'm an assurer)
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/92685BBB-D758-4582-BDBF-F0F9CDC6261C@gmail.com
Ok, thank you, Hraban. I've already checked that dTextBox works fine outside
the dabo demo; I'm worried about it no more. I'll try to play with your
solution, but my priority now is to keep learning Dabo.
Greetings
melkarth
--------------------------------------------------
From: "Henning Hraban Ramm" <fiee.visuelle@gmail.com>
Sent: Friday, May 20, 2011 7:58 AM
To: "Dabo Users list" <dabo-users@leafe.com>
Subject: Re: [dabo-users] Reenv: Problem in Dabo demo
> Am 2011-05-19 um 15:48 schrieb melkarth0:
>
>> As I said to Hraban, I have tested my programs with UTF-8 and they
>> also worked ok, I will use this coding in them from now on, instead
>> of latin-1.
>> I'm using an unicode wxPython, and dEditBox runs fine. I think it
>> must be something inside dTextBox.
>> When I enter this lowercase letter: http://en.wikipedia.org/wiki/%C3%81
>> , I get:
>>
>> File "C:\Python25\DABO\demo\samples/dTextBox.py", line 56, in
>> onTextKeyChar
>> cd, ch = evt.keyCode, evt.keyChar
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe1 in position
>> 0:
>> ordinal not in range(128)
>>
>> By the way, I'm only using DaboDemo.py now, not mixing with other
>> python
>> code.
>
> Ok, sorry I didn’t test yesterday - I can confirm the error in my
> environment (latest SVN):
> Platform: Mac
> Python Version: 2.6.4 on darwin
> Dabo Version: Version 0.9.3; Revision 6589M
> UI Version: 2.8.11.0 on wxMac
>
> Just making the strings in the handlers unicode (Melkart: enter a 'u'
> in front of the quotes) fixes the problem.
>
>
> Greetlings from Lake Constance!
> Hraban
> ---
> https://www.cacert.org (I'm an assurer)
>
>
>
>
> _______________________________________________
> Post Messages to: Dabo-users@leafe.com
> Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
> Searchable Archives: http://leafe.com/archives/search/dabo-users
> This message:
> http://leafe.com/archives/byMID/92685BBB-D758-4582-BDBF-F0F9CDC6261C@gmail.com
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/49DFDBB1998E4636A1C4A4C7645E77C2@Informatica2
Author: Henning Hraban Ramm
Posted: 2011-05-20 05:00:42 Link
Am 2011-05-20 um 09:06 schrieb melkarth0:
> Ok, thank you, Hraban. I've already checked that dTextBox works fine
> outside the dabo demo; I'm worried about it no more. I'll try to
> play with your solution, but my priority now is to keep learning Dabo.
But since you're learning Python as you go, it might be a good example
to keep attention to Python's quirks like ASCII vs. Unicode "strings".
Greetlings from Lake Constance!
Hraban
---
https://www.cacert.org (I'm an assurer)
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/143638ED-FEF9-4CFD-A5AF-2331E95C7533@fiee.net
Hraban :
Mmm. . . I know the difference between 'c' and u'c', but as I'm diving
into the modules of the demo, I'm getting lost. . .
>Just making the strings in the handlers unicode (Melkart: enter a 'u'
>in front of the quotes) fixes the problem.
Sorry, what handler is that?
With my current level of python, I only see a difference between the
dHyperLink demo (that contains a pair of text boxes and works ok) and
dTextBox (that does not), and this difference is the calling to:
txt.bindEvent(dEvents.KeyChar, self.onTextKeyChar) in the dTextBox demo.
In fact, if I comment this line, the text box works ok. So I go to sniff
around .egg\dabo\dEvents.py -> class KeyChar(KeyEvent) , and there I find
only 1 line: "pass". I Suppose this class has been subclassed somewhere...
got a headache, goto get an aspirin. Ah, the old "goto" spaghetti languages,
what a nostalgia!
Thank you for your patience,
melkarth
-----Original Message-----
From: dabo-users-bounces@leafe.com [mailto:dabo-users-bounces@leafe.com] On
Behalf Of Henning Hraban Ramm
Sent: viernes, 20 de mayo de 2011 11:01
To: Dabo list Users
Subject: Re: [dabo-users] Reenv: Problem in Dabo demo
Am 2011-05-20 um 09:06 schrieb melkarth0:
> Ok, thank you, Hraban. I've already checked that dTextBox works fine
> outside the dabo demo; I'm worried about it no more. I'll try to play
> with your solution, but my priority now is to keep learning Dabo.
But since you're learning Python as you go, it might be a good example to
keep attention to Python's quirks like ASCII vs. Unicode "strings".
Greetlings from Lake Constance!
Hraban
---
https://www.cacert.org (I'm an assurer)
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/143638ED-FEF9-4CFD-A5AF-2331E95C7533@fiee.ne
t
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/000501cc1701$65f87690$31e963b0$@gmail.com
Finally, it seems that I'm bound to 'latin-1' encoding.
I changed line 56 in dTextBox.py, in onTextKeyChar() section in the demo:
cd, ch = evt.keyCode, evt.keyChar
for this one:
cd, ch = evt.keyCode, unicode(evt.keyChar, 'latin-1')
and now runs fine and logit() displays a beautiful a-acute.
More, unicode(evt.keyChar, 'utf-8') doesn't work.
But, please, if anybody has a better approach, make me know it. I have a
conceptual confusion with this encodings stuff. For example, if I put the
line # -*- coding: latin-1 -*- on all the affected demo modules, will it
works as is?
Greetings
Melkarth
-----Original Message-----
From: dabo-users-bounces@leafe.com [mailto:dabo-users-bounces@leafe.com] On
Behalf Of Henning Hraban Ramm
Sent: viernes, 20 de mayo de 2011 11:01
To: Dabo list Users
Subject: Re: [dabo-users] Reenv: Problem in Dabo demo
Am 2011-05-20 um 09:06 schrieb melkarth0:
> Ok, thank you, Hraban. I've already checked that dTextBox works fine
> outside the dabo demo; I'm worried about it no more. I'll try to play
> with your solution, but my priority now is to keep learning Dabo.
But since you're learning Python as you go, it might be a good example to
keep attention to Python's quirks like ASCII vs. Unicode "strings".
Greetlings from Lake Constance!
Hraban
---
https://www.cacert.org (I'm an assurer)
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/143638ED-FEF9-4CFD-A5AF-2331E95C7533@fiee.ne
t
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/000501cc1785$1ec64020$5c52c060$@gmail.com
Just my 2 cents:
On 05/21/2011 10:02 AM, melkarth0 wrote:
> Finally, it seems that I'm bound to 'latin-1' encoding.
>
I'm starting to think that this is about wx putting a value to keyChar
in your systems default encoding instead of utf-8
> I changed line 56 in dTextBox.py, in onTextKeyChar() section in the demo:
>
> cd, ch = evt.keyCode, evt.keyChar
>
> for this one:
>
> cd, ch = evt.keyCode, unicode(evt.keyChar, 'latin-1')
>
> and now runs fine and logit() displays a beautiful a-acute.
>
> More, unicode(evt.keyChar, 'utf-8') doesn't work.
>
unicode(evt.keyChar, 'latin-1') actually sounds pretty sane.
You just need to dynamically get the default encoding via a property instead of hardcoding it.
I think this is dabo.getEncoding(), so try
unicode(evt.keyChar, dabo.getEncoding())
Most of us don't see this error because our default encoding is utf-8 anyway.
> But, please, if anybody has a better approach, make me know it. I have a
> conceptual confusion with this encodings stuff. For example, if I put the
> line # -*- coding: latin-1 -*- on all the affected demo modules, will it
> works as is?
>
> Greetings
> Melkarth
>
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4DD7B686.4080207@otenet.gr
Hello, Ed, Hraban and Nick.
I've found a nice way to solve the "dabo demo problem" with my
"latin-1"="iso8859-1" character set, without changing a single line of the
dabo framework.
Simply create a file " sitecustomize.py" under Lib\site-packages in my
python directory:
# sitecustomize.py
# this file can be anywhere in your Python path,
# but it usually goes in ${pythondir}/lib/site-packages/
import sys
sys.setdefaultencoding('iso8859-1')
This method "set the current default string encoding used by the Unicode
implementation" (Python library reference).
Before I made this 'discovery', I've tested Nick's proposal :
cd, ch = evt.keyCode, unicode(evt.keyChar, dabo.getEncoding())
. . . and :
File "C:\Projects\dabo\demo\samples/dTextBox.py", line 55, in
onTextKeyChar
def onTextKeyChar(self, evt):
AttributeError: 'module' object has no attribute 'getEncoding'
It seems that my dabo has no getEncoding() method.
The solution Ed gave me : to put 'settings_override.py' file in demo
folder, with line : defaultEncoding = "latin-1" did not work (no error, but
no different results).
Ok, now I'm done with the demo. It goes OK.
So I begin exploring the Dabo AppWizard and I've generated the CRUD/File
Management form. When I go to see the grid of customers (the Browse tab):
lots of wrong characters in the name and address columns!
Then, I've entered a new record and -Eureka, it's ok! -The new record is
exactly as I've entered. So, the other records already entered in the online
database were input by other users with other encodings. PHEW! Big relief.
melkarth
-----Original Message-----
From: dabo-users-bounces@leafe.com [mailto:dabo-users-bounces@leafe.com] On
Behalf Of Nick Raptis
Sent: sábado, 21 de mayo de 2011 14:57
To: dabo-users@leafe.com
Subject: Re: [dabo-users] Reenv: Problem in Dabo demo
Just my 2 cents:
On 05/21/2011 10:02 AM, melkarth0 wrote:
> Finally, it seems that I'm bound to 'latin-1' encoding.
>
I'm starting to think that this is about wx putting a value to keyChar in
your systems default encoding instead of utf-8
> I changed line 56 in dTextBox.py, in onTextKeyChar() section in the demo:
>
> cd, ch = evt.keyCode, evt.keyChar
>
> for this one:
>
> cd, ch = evt.keyCode, unicode(evt.keyChar, 'latin-1')
>
> and now runs fine and logit() displays a beautiful a-acute.
>
> More, unicode(evt.keyChar, 'utf-8') doesn't work.
>
unicode(evt.keyChar, 'latin-1') actually sounds pretty sane.
You just need to dynamically get the default encoding via a property instead
of hardcoding it.
I think this is dabo.getEncoding(), so try
unicode(evt.keyChar, dabo.getEncoding())
Most of us don't see this error because our default encoding is utf-8
anyway.
> But, please, if anybody has a better approach, make me know it. I have
> a conceptual confusion with this encodings stuff. For example, if I
> put the line # -*- coding: latin-1 -*- on all the affected demo
> modules, will it works as is?
>
> Greetings
> Melkarth
>
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/4DD7B686.4080207@otenet.gr
_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/000601cc18a2$1ec35c70$5c4a1550$@gmail.com