Hi Phill,
Noticed in your files that you mention that they are UTF-8 encoded,
however you don't put the declaration into your files?
You should have something like this at the top of each file, obviously
replace the iso-8859-1 with correct code for utf-8.
# coding: iso-8859-1
"g" is your translation stuff, instead of reinventing the wheel you
might want to look at the i18n support within Python and wxPython. They
are nice tools which allow to translate things into as many languages as
you want (including shipping the language catalogs to be translated to
someone else with nice GUI tools (I use "poedit" for that).
Check out the wiki pages for the i18n stuff and you might also check the
archive of this list.
I think your problem with "g" is this line:
dlg = wx.MessageDialog(self, g[credit_txt][L], g["Credits"][L], \
Wrong brackets, you are defining "g" as a list and "loose" your function g.
Hope this helps
Werner
Phill Atwood wrote:
Ira,
This one is still a mystery to me. MyClass declaration works. What
is below is a (too) abbreviated version from the code. It is when I
added the g def at the top of the file that it didn't work. I'm still
shakey on my python scope and oo too. I've resorted to a different
hack. Even uglier that is working at the moment. But I would like to
know why I get this error. There must be something else in the rest
of my code to cause this (see prev. post w/ attachment)
Phill
irakaplan (AT) optonline (DOT) net wrote:
>
>Phill,
>>
>Class MyClass's definition does not take parenthses unless it
>inherits methods and properties from a parent.
>>
>So the correct code is:
>>
>def g():
>pass
>>
>class MyClass:
>def func():
>g()
>>
>>
>Message
>From: Phill Atwood <me (AT) phillatwood (DOT) name>
>Date: Sunday, April 2, 2006 7:59 pm
>Subject: [wxPython-users] newbie object oriented question
>>
>
>>
How do I reference a global function from within a class
def g():
pass
class MyClass():
def func():
g()
this construct seems to give me an error:
UnboundLocalError: local variable 'g' referenced before assignment
Thanks,
Phill
-
To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
For additional commands, e-mail: wxPython-users-
help (AT) lists (DOT) wxwidgets.org
>>
>>
>
>To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
>For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
>
>
>
>
>
To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
>
>
>
To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org