Hi Mike,
Mike Driscoll wrote:
Hi,
In writing my next tutorial on porting wxPyMail to Ubuntu, I found that my wxPython code worked very well with almost no modification. Unfortunately, while I can get it to run from the command line by calling "python myprog.py", I can't get it to run when I click on a link in a web page.
If someone could take a look at my tutorial and figure out what I'm doing wrong, that would be great. I'm sure it has something to do with not setting up my shell script or my snake script correctly. Any advice would be appreciated:
Here's the link: Porting wxPyMail to Linux - Mouse Vs Python
I'm using Ubuntu Hardy Heron, wxPython 2.8.8.1 and Python 2.5.2.
I have no answer to your problem but a couple of comments.
I am trying it out on Windows Vista.
- part of my from e-mail address is not shown, i.e. to see it I have to position the cursor at the beginning of the textctrl.
- you require a login to the smpt server. I am in France connected to the net with a free.fr ADSL/Broadband connection and there is no login to the smtp server.
- I see the following in the Boa output/stdout window:
['wxPyMail.py']
Unable to execute parseURL...
list index out of range
But the program works nicely, after I commented the login call.
What about using the maskedit control for the email address entries. There is an option so it checks that you enter a valid email and it also has an option to autosize itself based on the number of characters you defined and gives feedback to the user that data is required (see emptyInvalid and yellow background).
The code changes to use masked would be:
import wx.lib.masked as masked
#### self.fromTxt = wx.TextCtrl(p, id=wx.ID_ANY, value=self.email)
self.fromTxt = masked.TextCtrl(p, id=wx.ID_ANY)
self.fromTxt.SetCtrlParameters(mask = "X{70}", formatcodes = "F_S>",
autoformat = u'EMAIL',
emptyInvalid = True)
self.fromTxt.SetValue(self.email)
self.toLbl = wx.StaticText(p, id=wx.ID_ANY, label='To:', size=(60,-1))
#### self.toTxt = wx.TextCtrl(p, id=wx.ID_ANY, value='')
self.toTxt = masked.TextCtrl(p, id=wx.ID_ANY)
self.toTxt.SetCtrlParameters(mask = "X{70}", formatcodes = "F_S>",
autoformat = u'EMAIL',
emptyInvalid = True)
Werner