Mercurial > cpython-lru_cache-weakref
annotate Mac/PythonLauncher/MyDocument.m @ 87690:66c1c9f32567 default tip
Add use_weakref option to functools.lru_cache
The use_weakref option makes lru_cache create weak references to the function
arguments when creating the cache key, which prevents them from staying in the
memory forever even after all other references to them are gone.
This is a proof of concept for http://bugs.python.org/issue19859
| author | Radomir Dopieralski <devel@sheep.art.pl> |
|---|---|
| date | Tue, 03 Dec 2013 16:02:48 +0100 |
| parents | 738cba2bf849 |
| children |
| rev | line source |
|---|---|
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
1 // |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
2 // MyDocument.m |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
3 // PythonLauncher |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
4 // |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
5 // Created by Jack Jansen on Fri Jul 19 2002. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
6 // Copyright (c) 2002 __MyCompanyName__. All rights reserved. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
7 // |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
8 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
9 #import "MyDocument.h" |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
10 #import "MyAppDelegate.h" |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
11 #import "doscript.h" |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
12 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
13 @implementation MyDocument |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
14 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
15 - (id)init |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
16 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
17 self = [super init]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
18 if (self) { |
|
84479
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
19 |
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
20 // Add your subclass-specific initialization here. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
21 // If an error occurs here, send a [self dealloc] message and return nil. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
22 script = [@"<no script>.py" retain]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
23 filetype = [@"Python Script" retain]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
24 settings = NULL; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
25 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
26 return self; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
27 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
28 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
29 - (NSString *)windowNibName |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
30 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
31 // Override returning the nib file name of the document |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
32 // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
33 return @"MyDocument"; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
34 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
35 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
36 - (void)close |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
37 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
38 NSApplication *app = [NSApplication sharedApplication]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
39 [super close]; |
|
84479
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
40 if ([(MyAppDelegate*)[app delegate] shouldTerminate]) |
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
41 [app terminate: self]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
42 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
43 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
44 - (void)load_defaults |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
45 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
46 settings = [FileSettings newSettingsForFileType: filetype]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
47 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
48 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
49 - (void)update_display |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
50 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
51 [interpreter setStringValue: [settings interpreter]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
52 [honourhashbang setState: [settings honourhashbang]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
53 [debug setState: [settings debug]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
54 [verbose setState: [settings verbose]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
55 [inspect setState: [settings inspect]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
56 [optimize setState: [settings optimize]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
57 [nosite setState: [settings nosite]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
58 [tabs setState: [settings tabs]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
59 [others setStringValue: [settings others]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
60 [scriptargs setStringValue: [settings scriptargs]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
61 [with_terminal setState: [settings with_terminal]]; |
|
84479
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
62 |
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
63 [commandline setStringValue: [settings commandLineForScript: script]]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
64 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
65 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
66 - (void)update_settings |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
67 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
68 [settings updateFromSource: self]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
69 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
70 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
71 - (BOOL)run |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
72 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
73 const char *cmdline; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
74 int sts; |
|
84479
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
75 |
|
84458
27eb350d5056
Issue #12990: The "Python Launcher" on OSX could not launch python scripts that have paths that include wide characters.
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
46664
diff
changeset
|
76 cmdline = [[settings commandLineForScript: script] UTF8String]; |
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
77 if ([settings with_terminal]) { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
78 sts = doscript(cmdline); |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
79 } else { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
80 sts = system(cmdline); |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
81 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
82 if (sts) { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
83 NSLog(@"Exit status: %d\n", sts); |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
84 return NO; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
85 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
86 return YES; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
87 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
88 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
89 - (void)windowControllerDidLoadNib:(NSWindowController *) aController |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
90 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
91 [super windowControllerDidLoadNib:aController]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
92 // Add any code here that need to be executed once the windowController has loaded the document's window. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
93 [self load_defaults]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
94 [self update_display]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
95 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
96 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
97 - (NSData *)dataRepresentationOfType:(NSString *)aType |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
98 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
99 // Insert code here to write your document from the given data. You can also choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: instead. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
100 return nil; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
101 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
102 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
103 - (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
104 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
105 // Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofType: instead. |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
106 BOOL show_ui; |
|
84479
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
107 |
|
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
108 // ask the app delegate whether we should show the UI or not. |
|
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
109 show_ui = [(MyAppDelegate*)[[NSApplication sharedApplication] delegate] shouldShowUI]; |
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
110 [script release]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
111 script = [fileName retain]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
112 [filetype release]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
113 filetype = [type retain]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
114 settings = [FileSettings newSettingsForFileType: filetype]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
115 if (show_ui) { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
116 [self update_display]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
117 return YES; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
118 } else { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
119 [self run]; |
|
46664
031dfe455585
Merged revisions 62425-62429,62434-62436,62441,62444,62446-62448,62450-62455,62463,62465-62466,62469,62474,62476-62478,62480,62485,62492,62497-62498,62500,62507,62513-62514,62516,62521,62531,62535,62545-62546,62548-62551,62553-62559,62569,62574,62577,62593,62595,62604-62606,62608,62616,62626-62627,62636,62638,62644-62645,62647-62648,62651-62653,62656,62661,62663,62680,62686-62687,62696,62699-62703,62711 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
38673
diff
changeset
|
120 [self performSelector:@selector(close) withObject:nil afterDelay:0.0]; |
|
031dfe455585
Merged revisions 62425-62429,62434-62436,62441,62444,62446-62448,62450-62455,62463,62465-62466,62469,62474,62476-62478,62480,62485,62492,62497-62498,62500,62507,62513-62514,62516,62521,62531,62535,62545-62546,62548-62551,62553-62559,62569,62574,62577,62593,62595,62604-62606,62608,62616,62626-62627,62636,62638,62644-62645,62647-62648,62651-62653,62656,62661,62663,62680,62686-62687,62696,62699-62703,62711 via svnmerge from
Christian Heimes <christian@cheimes.de>
parents:
38673
diff
changeset
|
121 return YES; |
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
122 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
123 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
124 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
125 - (IBAction)do_run:(id)sender |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
126 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
127 [self update_settings]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
128 [self update_display]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
129 if ([self run]) |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
130 [self close]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
131 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
132 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
133 - (IBAction)do_cancel:(id)sender |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
134 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
135 [self close]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
136 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
137 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
138 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
139 - (IBAction)do_reset:(id)sender |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
140 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
141 [settings reset]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
142 [self update_display]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
143 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
144 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
145 - (IBAction)do_apply:(id)sender |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
146 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
147 [self update_settings]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
148 [self update_display]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
149 } |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
150 |
|
84479
738cba2bf849
Issue #18377: Code cleanup in Python Launcher
Ronald Oussoren <ronaldoussoren@mac.com>
parents:
84458
diff
changeset
|
151 // FileSettingsSource protocol |
|
38673
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
152 - (NSString *) interpreter { return [interpreter stringValue];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
153 - (BOOL) honourhashbang { return [honourhashbang state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
154 - (BOOL) debug { return [debug state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
155 - (BOOL) verbose { return [verbose state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
156 - (BOOL) inspect { return [inspect state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
157 - (BOOL) optimize { return [optimize state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
158 - (BOOL) nosite { return [nosite state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
159 - (BOOL) tabs { return [tabs state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
160 - (NSString *) others { return [others stringValue];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
161 - (NSString *) scriptargs { return [scriptargs stringValue];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
162 - (BOOL) with_terminal { return [with_terminal state];}; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
163 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
164 // Delegates |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
165 - (void)controlTextDidChange:(NSNotification *)aNotification |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
166 { |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
167 [self update_settings]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
168 [self update_display]; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
169 }; |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
170 |
|
a19c20c5e5c7
Merge the rest of the trunk.
Thomas Wouters <thomas@python.org>
parents:
diff
changeset
|
171 @end |
