Nick: my Dabo 0.9.3-py2.5 is a mutant!  Has no getEncoding() :

>>> import dabo
>>> dabo.getEncoding()

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    dabo.getEncoding()
AttributeError: 'module' object has no attribute 'getEncoding'

>>> dir(dabo.__init__)
['__call__', '__class__', '__cmp__', '__delattr__', '__doc__',
'__getattribute__', '__hash__', '__init__', '__name__', '__new__',
'__objclass__', '__reduce__', '__reduce_ex__', '__repr__', '__self__',
'__setattr__', '__str__']

melkarth

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Nick Raptis
Sent: domingo, 22 de mayo de 2011 23:55
To: [email protected]
Subject: Re: [dabo-users] Reenv: Problem in Dabo demo


On 05/22/2011 08:03 PM, melkarth0 wrote:
> 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'
>
Hehe, strange because it's in dabo's __init__.py and surely:

Python 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] on linux2 Type
"help", "copyright", "credits" or "license" for more information.
 >>> import dabo
 >>> dabo.getEncoding()
'UTF8'
 >>>

Whatever, I'm glad you sorted this out. Will keep your workaround in mind ;)

> 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
>
_______________________________________________
Post Messages to: [email protected]
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/[email protected]

_______________________________________________
Post Messages to: [email protected]
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/[email protected]

Reply via email to