diff options
author | Benjamin Peterson <benjamin@python.org> | 2008-07-01 18:23:09 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2008-07-01 18:23:09 (GMT) |
commit | de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2 (patch) | |
tree | da0b9c0e9d56288354f936b59021d94018a172a8 /Mac/Demo/example2 | |
parent | bbfd71d7ac02bc2053a0ba494a3f055fbec8deee (diff) | |
download | cpython-de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2.zip cpython-de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2.tar.gz cpython-de9c869fb8c1f842bc3dfc4d51f287cb6b644ab2.tar.bz2 |
Hopefully fix make framework install on Mac (see 3174)
Removal of the Mac modules broke many of the Mac scripts (including
BuildApplet.py) so the building of the Python launcher and IDLE.app was
broken. I manually copied built versions of those apps into Mac. Everything else
which used Mac modules had to die.
Diffstat (limited to 'Mac/Demo/example2')
-rw-r--r-- | Mac/Demo/example2/dnslookup-2.gif | bin | 2984 -> 0 bytes | |||
-rw-r--r-- | Mac/Demo/example2/dnslookup-2.py | 85 | ||||
-rw-r--r-- | Mac/Demo/example2/dnslookup-2.rsrc | bin | 707 -> 0 bytes |
3 files changed, 0 insertions, 85 deletions
diff --git a/Mac/Demo/example2/dnslookup-2.gif b/Mac/Demo/example2/dnslookup-2.gif Binary files differdeleted file mode 100644 index cd5fe5f..0000000 --- a/Mac/Demo/example2/dnslookup-2.gif +++ /dev/null diff --git a/Mac/Demo/example2/dnslookup-2.py b/Mac/Demo/example2/dnslookup-2.py deleted file mode 100644 index fc3db66..0000000 --- a/Mac/Demo/example2/dnslookup-2.py +++ /dev/null @@ -1,85 +0,0 @@ -import FrameWork -import EasyDialogs -from Carbon import Res -from Carbon import Dlg -import socket -import string -import macresource -# -# Definitions for our resources -ID_MAIN=512 -ID_ABOUT=513 - -ITEM_LOOKUP_ENTRY=1 -ITEM_RESULT=2 -ITEM_LOOKUP_BUTTON=3 - -def main(): - macresource.need("DLOG", ID_MAIN, "dnslookup-2.rsrc") - DNSLookup() - -class DNSLookup(FrameWork.Application): - "Application class for DNS Lookup" - - def __init__(self): - # First init menus, etc. - FrameWork.Application.__init__(self) - # Next create our dialog - self.main_dialog = MyDialog(self) - # Now open the dialog - self.main_dialog.open(ID_MAIN) - # Finally, go into the event loop - self.mainloop() - - def makeusermenus(self): - self.filemenu = m = FrameWork.Menu(self.menubar, "File") - self.quititem = FrameWork.MenuItem(m, "Quit", "Q", self.quit) - - def quit(self, *args): - self._quit() - - def do_about(self, *args): - f = Dlg.GetNewDialog(ID_ABOUT, -1) - while 1: - n = Dlg.ModalDialog(None) - if n == 1: - return - -class MyDialog(FrameWork.DialogWindow): - "Main dialog window for DNSLookup" - def __init__(self, parent): - FrameWork.DialogWindow.__init__(self, parent) - self.parent = parent - - def do_itemhit(self, item, event): - if item == ITEM_LOOKUP_BUTTON: - self.dolookup() - - def dolookup(self): - """Get text entered in the lookup entry area. Place result of the - call to dnslookup in the result entry area.""" - tp, h, rect = self.dlg.GetDialogItem(ITEM_LOOKUP_ENTRY) - txt = Dlg.GetDialogItemText(h) - - tp, h, rect = self.dlg.GetDialogItem(ITEM_RESULT) - Dlg.SetDialogItemText(h, self.dnslookup(txt)) - - def dnslookup(self, str): - """ Perform DNS lookup on str. If first character of digit is numeric, - assume that str contains an IP address. Otherwise, assume that str - contains a hostname.""" - if str == '': str = ' ' - if str[0] in string.digits: - try: - value = socket.gethostbyaddr(str)[0] - except: - value = 'Lookup failed' - else: - try: - value = socket.gethostbyname(str) - except: - value = 'Lookup failed' - return value - - -main() diff --git a/Mac/Demo/example2/dnslookup-2.rsrc b/Mac/Demo/example2/dnslookup-2.rsrc Binary files differdeleted file mode 100644 index 17b22d9..0000000 --- a/Mac/Demo/example2/dnslookup-2.rsrc +++ /dev/null |