Mercurial > cpython-lru_cache-weakref
comparison Mac/scripts/EditPythonPrefs.py @ 19515:546ef318ba5d legacy-trunk
Use the new macresource module to open the accompanying resource file (if needed).
| author | Jack Jansen <jack.jansen@cwi.nl> |
|---|---|
| date | Mon, 27 Aug 2001 21:41:23 +0000 |
| parents | 42b2f1936254 |
| children | f4af27cb2632 |
comparison
equal
deleted
inserted
replaced
| 19514:b1acbcf7d586 | 19515:546ef318ba5d |
|---|---|
| 13 import MacOS | 13 import MacOS |
| 14 import os | 14 import os |
| 15 import sys | 15 import sys |
| 16 from Carbon import Res # For Res.Error | 16 from Carbon import Res # For Res.Error |
| 17 import pythonprefs | 17 import pythonprefs |
| 18 import macresource | |
| 18 import EasyDialogs | 19 import EasyDialogs |
| 19 try: | 20 try: |
| 20 from Carbon import Help | 21 from Carbon import Help |
| 21 except ImportError: | 22 except ImportError: |
| 22 Help = None | 23 Help = None |
| 193 result = interact(handler.load(), os.path.split(name)[1]) | 194 result = interact(handler.load(), os.path.split(name)[1]) |
| 194 if result: | 195 if result: |
| 195 handler.save(result) | 196 handler.save(result) |
| 196 | 197 |
| 197 def main(): | 198 def main(): |
| 198 try: | 199 macresource.need('DLOG', DIALOG_ID, 'EditPythonPrefs.rsrc') |
| 199 h = FSpOpenResFile('EditPythonPrefs.rsrc', 1) | |
| 200 except Res.Error: | |
| 201 pass # Assume we already have acces to our own resource | |
| 202 | 200 |
| 203 MacOS.SchedParams(1, 0) | 201 MacOS.SchedParams(1, 0) |
| 204 if len(sys.argv) <= 1: | 202 if len(sys.argv) <= 1: |
| 205 edit_preferences() | 203 edit_preferences() |
| 206 else: | 204 else: |
