def onShorten(self, event):
"""
Shortens a URL using the service specified.
Then sets the text control to the new URL.
"""
text = self.inputURLTxt.GetValue()
textLength = len(text)
if re.match("^https?://[^ ]+", text) and textLength > 20:
pass
else:
wx.MessageBox("URL is already tiny!", "Error")
return
URL = self.URLCbo.GetValue()
if URL == "is.gd":
self.shortenWithIsGd(text)
elif URL == "bit.ly":
self.shortenWithBitly(text)
elif URL == "tinyurl":
self.shortenWithTinyURL(text)
评论列表
文章目录