Jack Jansen | 4892ab7 | 1996-09-24 15:35:50 +0000 | [diff] [blame] | 1 | """Edit a file using the MetroWerks editor. Modify to suit your needs""" |
| 2 | |
| 3 | import MacOS |
| 4 | import aetools |
| 5 | import Metrowerks_Shell_Suite |
| 6 | import Required_Suite |
| 7 | |
| 8 | _talker = None |
| 9 | |
| 10 | class MWShell(aetools.TalkTo, |
| 11 | Metrowerks_Shell_Suite.Metrowerks_Shell_Suite, |
| 12 | Required_Suite.Required_Suite): |
| 13 | pass |
| 14 | |
| 15 | def edit(file, line): |
| 16 | global _talker |
| 17 | if _talker == None: |
| 18 | _talker = MWShell('CWIE', start=1) |
| 19 | try: |
| 20 | _talker.open(file) |
| 21 | _talker.Goto_Line(line) |
| 22 | except "(MacOS.Error, aetools.Error)": |
| 23 | pass |
| 24 | |