IpAddrCtrl.SetValue() problems

R

rob

Hello! :)

I'm relatively new to python so bear with me. I have run into a
problem with IPAddrCtrl and can't seem to find any info on google etc.
Here is a code snippet from my app and the error. I just want to set
a default value in the IP address field from a variable read from a
config file is all...

CODE:
(just the important bits)
NOTE: I changed the 2nd import a little to make it more ovbious that I
was using masked.IPAddrCtrl in the code.
-----------
#from wx.lib.maskededit import IpAddrCtrl ## old import format
import wx.lib.masked as masked

self.ip = masked.IpAddrCtrl(self, -1, style = wx.TE_PROCESS_TAB)
self.ip.SetValue(config.Get("ipaddress"))

-----------

ERROR:
Traceback (most recent call last):
File "mydlg.pyo", line 787, in IPAddrDialog
File "mydlg.pyo", line 240, in __init__
File "wx\lib\masked\ipaddrctrl.pyo", line 148, in SetValue
NameError: global name 'types' is not defined

Oh and I'm using wxpython 2.5.2.8u and Python 2.3.4. I did have this
working with the previous version of wxpython (2.5.1.5u) and I have
changed the imports accordingly (I think). Can anyone help me out
with this as I have been stuck on this for a few days now.

Thanks

-Rob
 
P

Peter L Hansen

rob said:
I'm relatively new to python so bear with me. I have run into a
problem with IPAddrCtrl and can't seem to find any info on google etc.

IPAddrCtrl is part of wxPython. wxPython has its own mailing list,
where you will generally get more, better, or faster responses
than if you ask here.
ERROR:
Traceback (most recent call last):
File "mydlg.pyo", line 787, in IPAddrDialog
File "mydlg.pyo", line 240, in __init__
File "wx\lib\masked\ipaddrctrl.pyo", line 148, in SetValue
NameError: global name 'types' is not defined

"types" is a module in the Python standard library. Looking
at the source for ipaddrctrl, in \python23\lib\site-packages\
wx\lib\masked\ipaddrctrl.py, you can see that line 148
tries to use items from that module, but the module has
never been imported!

This is a bug in wxPython. Please report it in the bug tracker at
http://sourceforge.net/tracker/?group_id=9863&atid=109863 .

-Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
474,209
Messages
2,571,088
Members
47,684
Latest member
sparada

Latest Threads

Top