Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(65)

Delta Between Two Patch Sets: Mac/PythonLauncher/MyDocument.m

Issue 15550: Trailing white spaces
Left Patch Set: Created 7 years, 6 months ago
Right Patch Set: Created 7 years, 6 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « Mac/PythonLauncher/MyAppDelegate.m ('k') | Mac/PythonLauncher/PreferencesWindowController.m » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // 1 //
2 // MyDocument.m 2 // MyDocument.m
3 // PythonLauncher 3 // PythonLauncher
4 // 4 //
5 // Created by Jack Jansen on Fri Jul 19 2002. 5 // Created by Jack Jansen on Fri Jul 19 2002.
6 // Copyright (c) 2002 __MyCompanyName__. All rights reserved. 6 // Copyright (c) 2002 __MyCompanyName__. All rights reserved.
7 // 7 //
8 8
9 #import "MyDocument.h" 9 #import "MyDocument.h"
10 #import "MyAppDelegate.h" 10 #import "MyAppDelegate.h"
11 #import "doscript.h" 11 #import "doscript.h"
12 12
13 @implementation MyDocument 13 @implementation MyDocument
14 14
15 - (id)init 15 - (id)init
16 { 16 {
17 self = [super init]; 17 self = [super init];
18 if (self) { 18 if (self) {
19 19
20 // Add your subclass-specific initialization here. 20 // Add your subclass-specific initialization here.
21 // If an error occurs here, send a [self dealloc] message and return nil . 21 // If an error occurs here, send a [self dealloc] message and return nil .
22 script = [@"<no script>.py" retain]; 22 script = [@"<no script>.py" retain];
23 filetype = [@"Python Script" retain]; 23 filetype = [@"Python Script" retain];
24 settings = NULL; 24 settings = NULL;
25 } 25 }
26 return self; 26 return self;
27 } 27 }
28 28
29 - (NSString *)windowNibName 29 - (NSString *)windowNibName
(...skipping 13 matching lines...) Expand all
43 43
44 - (void)load_defaults 44 - (void)load_defaults
45 { 45 {
46 // if (settings) [settings release]; 46 // if (settings) [settings release];
47 settings = [FileSettings newSettingsForFileType: filetype]; 47 settings = [FileSettings newSettingsForFileType: filetype];
48 } 48 }
49 49
50 - (void)update_display 50 - (void)update_display
51 { 51 {
52 // [[self window] setTitle: script]; 52 // [[self window] setTitle: script];
53 53
54 [interpreter setStringValue: [settings interpreter]]; 54 [interpreter setStringValue: [settings interpreter]];
55 [honourhashbang setState: [settings honourhashbang]]; 55 [honourhashbang setState: [settings honourhashbang]];
56 [debug setState: [settings debug]]; 56 [debug setState: [settings debug]];
57 [verbose setState: [settings verbose]]; 57 [verbose setState: [settings verbose]];
58 [inspect setState: [settings inspect]]; 58 [inspect setState: [settings inspect]];
59 [optimize setState: [settings optimize]]; 59 [optimize setState: [settings optimize]];
60 [nosite setState: [settings nosite]]; 60 [nosite setState: [settings nosite]];
61 [tabs setState: [settings tabs]]; 61 [tabs setState: [settings tabs]];
62 [others setStringValue: [settings others]]; 62 [others setStringValue: [settings others]];
63 [scriptargs setStringValue: [settings scriptargs]]; 63 [scriptargs setStringValue: [settings scriptargs]];
64 [with_terminal setState: [settings with_terminal]]; 64 [with_terminal setState: [settings with_terminal]];
65 65
66 [commandline setStringValue: [settings commandLineForScript: script]]; 66 [commandline setStringValue: [settings commandLineForScript: script]];
67 } 67 }
68 68
69 - (void)update_settings 69 - (void)update_settings
70 { 70 {
71 [settings updateFromSource: self]; 71 [settings updateFromSource: self];
72 } 72 }
73 73
74 - (BOOL)run 74 - (BOOL)run
75 { 75 {
76 const char *cmdline; 76 const char *cmdline;
77 int sts; 77 int sts;
78 78
79 cmdline = [[settings commandLineForScript: script] cString]; 79 cmdline = [[settings commandLineForScript: script] cString];
80 if ([settings with_terminal]) { 80 if ([settings with_terminal]) {
81 sts = doscript(cmdline); 81 sts = doscript(cmdline);
82 } else { 82 } else {
83 sts = system(cmdline); 83 sts = system(cmdline);
84 } 84 }
85 if (sts) { 85 if (sts) {
86 NSLog(@"Exit status: %d\n", sts); 86 NSLog(@"Exit status: %d\n", sts);
87 return NO; 87 return NO;
88 } 88 }
(...skipping 11 matching lines...) Expand all
100 - (NSData *)dataRepresentationOfType:(NSString *)aType 100 - (NSData *)dataRepresentationOfType:(NSString *)aType
101 { 101 {
102 // Insert code here to write your document from the given data. You can als o choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: i nstead. 102 // Insert code here to write your document from the given data. You can als o choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: i nstead.
103 return nil; 103 return nil;
104 } 104 }
105 105
106 - (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type; 106 - (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type;
107 { 107 {
108 // Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofTy pe: instead. 108 // Insert code here to read your document from the given data. You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofTy pe: instead.
109 BOOL show_ui; 109 BOOL show_ui;
110 110
111 // ask the app delegate whether we should show the UI or not. 111 // ask the app delegate whether we should show the UI or not.
112 show_ui = [[[NSApplication sharedApplication] delegate] shouldShowUI]; 112 show_ui = [[[NSApplication sharedApplication] delegate] shouldShowUI];
113 [script release]; 113 [script release];
114 script = [fileName retain]; 114 script = [fileName retain];
115 [filetype release]; 115 [filetype release];
116 filetype = [type retain]; 116 filetype = [type retain];
117 // if (settings) [settings release]; 117 // if (settings) [settings release];
118 settings = [FileSettings newSettingsForFileType: filetype]; 118 settings = [FileSettings newSettingsForFileType: filetype];
119 if (show_ui) { 119 if (show_ui) {
120 [self update_display]; 120 [self update_display];
121 return YES; 121 return YES;
(...skipping 23 matching lines...) Expand all
145 [settings reset]; 145 [settings reset];
146 [self update_display]; 146 [self update_display];
147 } 147 }
148 148
149 - (IBAction)do_apply:(id)sender 149 - (IBAction)do_apply:(id)sender
150 { 150 {
151 [self update_settings]; 151 [self update_settings];
152 [self update_display]; 152 [self update_display];
153 } 153 }
154 154
155 // FileSettingsSource protocol 155 // FileSettingsSource protocol
156 - (NSString *) interpreter { return [interpreter stringValue];}; 156 - (NSString *) interpreter { return [interpreter stringValue];};
157 - (BOOL) honourhashbang { return [honourhashbang state];}; 157 - (BOOL) honourhashbang { return [honourhashbang state];};
158 - (BOOL) debug { return [debug state];}; 158 - (BOOL) debug { return [debug state];};
159 - (BOOL) verbose { return [verbose state];}; 159 - (BOOL) verbose { return [verbose state];};
160 - (BOOL) inspect { return [inspect state];}; 160 - (BOOL) inspect { return [inspect state];};
161 - (BOOL) optimize { return [optimize state];}; 161 - (BOOL) optimize { return [optimize state];};
162 - (BOOL) nosite { return [nosite state];}; 162 - (BOOL) nosite { return [nosite state];};
163 - (BOOL) tabs { return [tabs state];}; 163 - (BOOL) tabs { return [tabs state];};
164 - (NSString *) others { return [others stringValue];}; 164 - (NSString *) others { return [others stringValue];};
165 - (NSString *) scriptargs { return [scriptargs stringValue];}; 165 - (NSString *) scriptargs { return [scriptargs stringValue];};
166 - (BOOL) with_terminal { return [with_terminal state];}; 166 - (BOOL) with_terminal { return [with_terminal state];};
167 167
168 // Delegates 168 // Delegates
169 - (void)controlTextDidChange:(NSNotification *)aNotification 169 - (void)controlTextDidChange:(NSNotification *)aNotification
170 { 170 {
171 [self update_settings]; 171 [self update_settings];
172 [self update_display]; 172 [self update_display];
173 }; 173 };
174 174
175 @end 175 @end
LEFTRIGHT

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+