diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-27 21:41:23 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2001-08-27 21:41:23 (GMT) |
commit | 3c06b9a7d4fa144eebd4786f71c4a301726e0c3c (patch) | |
tree | 4f9cdc3420a0b7d6cd76ec44245df09628e98993 /Mac/Demo/example2/dnslookup-2.py | |
parent | a5d7da528bda145426c50ad9ded8d0707d5f302c (diff) | |
download | cpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.zip cpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.tar.gz cpython-3c06b9a7d4fa144eebd4786f71c4a301726e0c3c.tar.bz2 |
Use the new macresource module to open the accompanying resource file (if needed).
Diffstat (limited to 'Mac/Demo/example2/dnslookup-2.py')
-rw-r--r-- | Mac/Demo/example2/dnslookup-2.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Mac/Demo/example2/dnslookup-2.py b/Mac/Demo/example2/dnslookup-2.py index 20e7fa5..9747c4a 100644 --- a/Mac/Demo/example2/dnslookup-2.py +++ b/Mac/Demo/example2/dnslookup-2.py @@ -5,6 +5,7 @@ from Carbon import Dlg import sys import socket import string +import macresource # # Definitions for our resources ID_MAIN=512 @@ -15,14 +16,7 @@ ITEM_RESULT=2 ITEM_LOOKUP_BUTTON=3 def main(): - try: - dummy = Res.GetResource('DLOG', ID_MAIN) - except Res.Error: - try: - Res.FSpOpenResFile("dnslookup-2.rsrc", 1) - except Res.Error: - EasyDialogs.Message("Cannot open dnslookup-2.rsrc") - sys.exit(1) + macresource.need("DLOG", ID_MAIN, "dnslookup-2.rsrc") DNSLookup() class DNSLookup(FrameWork.Application): |