@@ -14,7 +14,7 @@ + (id)getFactorySettingsForFileType: (NSString *)filetype
1414{
1515 static FileSettings *fsdefault_py, *fsdefault_pyw, *fsdefault_pyc;
1616 FileSettings **curdefault;
17-
17+
1818 if ([filetype isEqualToString: @" Python Script" ]) {
1919 curdefault = &fsdefault_py;
2020 } else if ([filetype isEqualToString: @" Python GUI Script" ]) {
@@ -36,7 +36,7 @@ + (id)getDefaultsForFileType: (NSString *)filetype
3636{
3737 static FileSettings *default_py, *default_pyw, *default_pyc;
3838 FileSettings **curdefault;
39-
39+
4040 if ([filetype isEqualToString: @" Python Script" ]) {
4141 curdefault = &default_py;
4242 } else if ([filetype isEqualToString: @" Python GUI Script" ]) {
@@ -57,7 +57,7 @@ + (id)getDefaultsForFileType: (NSString *)filetype
5757+ (id )newSettingsForFileType : (NSString *)filetype
5858{
5959 FileSettings *cur;
60-
60+
6161 cur = [FileSettings new ];
6262 [cur initForFileType: filetype];
6363 return [cur retain ];
@@ -67,7 +67,7 @@ - (id)initWithFileSettings: (FileSettings *)source
6767{
6868 self = [super init ];
6969 if (!self) return self;
70-
70+
7171 interpreter = [source->interpreter retain ];
7272 honourhashbang = source->honourhashbang ;
7373 debug = source->debug ;
@@ -81,36 +81,30 @@ - (id)initWithFileSettings: (FileSettings *)source
8181 with_terminal = source->with_terminal ;
8282 prefskey = source->prefskey ;
8383 if (prefskey) [prefskey retain ];
84-
84+
8585 return self;
8686}
8787
8888- (id )initForFileType : (NSString *)filetype
8989{
9090 FileSettings *defaults;
91-
91+
9292 defaults = [FileSettings getDefaultsForFileType: filetype];
9393 self = [self initWithFileSettings: defaults];
9494 origsource = [defaults retain ];
9595 return self;
9696}
9797
98- // - (id)init
99- // {
100- // self = [self initForFileType: @"Python Script"];
101- // return self;
102- // }
103-
10498- (id )initForFSDefaultFileType : (NSString *)filetype
10599{
106100 int i;
107101 NSString *filename;
108102 NSDictionary *dict;
109103 static NSDictionary *factorySettings;
110-
104+
111105 self = [super init ];
112106 if (!self) return self;
113-
107+
114108 if (factorySettings == NULL ) {
115109 NSBundle *bdl = [NSBundle mainBundle ];
116110 NSString *path = [ bdl pathForResource: @" factorySettings"
@@ -149,18 +143,18 @@ - (void)applyUserDefaults: (NSString *)filetype
149143{
150144 NSUserDefaults *defaults;
151145 NSDictionary *dict;
152-
146+
153147 defaults = [NSUserDefaults standardUserDefaults ];
154148 dict = [defaults dictionaryForKey: filetype];
155149 if (!dict)
156150 return ;
157151 [self applyValuesFromDict: dict];
158152}
159-
153+
160154- (id )initForDefaultFileType : (NSString *)filetype
161155{
162156 FileSettings *fsdefaults;
163-
157+
164158 fsdefaults = [FileSettings getFactorySettingsForFileType: filetype];
165159 self = [self initWithFileSettings: fsdefaults];
166160 if (!self) return self;
@@ -220,7 +214,7 @@ - (void)updateFromSource: (id <FileSettingsSource>)source
220214- (void )applyValuesFromDict : (NSDictionary *)dict
221215{
222216 id value;
223-
217+
224218 value = [dict objectForKey: @" interpreter" ];
225219 if (value) interpreter = [value retain ];
226220 value = [dict objectForKey: @" honourhashbang" ];
@@ -247,12 +241,12 @@ - (void)applyValuesFromDict: (NSDictionary *)dict
247241
248242- (NSString *)_replaceSingleQuotes : (NSString *)string
249243{
250- /* Replace all single-quotes by '"'"', that way shellquoting will
251- * be correct when the result value is delimited using single quotes.
252- */
253- NSArray * components = [string componentsSeparatedByString: @" '" ];
244+ /* Replace all single-quotes by '"'"', that way shellquoting will
245+ * be correct when the result value is delimited using single quotes.
246+ */
247+ NSArray * components = [string componentsSeparatedByString: @" '" ];
254248
255- return [components componentsJoinedByString: @" '\" '\" '" ];
249+ return [components componentsJoinedByString: @" '\" '\" '" ];
256250}
257251
258252- (NSString *)commandLineForScript : (NSString *)script
@@ -265,7 +259,7 @@ - (NSString *)commandLineForScript: (NSString *)script
265259
266260 script_dir = [script substringToIndex:
267261 [script length ]-[[script lastPathComponent ] length ]];
268-
262+
269263 if (honourhashbang &&
270264 (fp=fopen ([script fileSystemRepresentation ], " r" )) &&
271265 fgets (hashbangbuf, sizeof (hashbangbuf), fp) &&
@@ -278,7 +272,7 @@ - (NSString *)commandLineForScript: (NSString *)script
278272 }
279273 if (!cur_interp)
280274 cur_interp = interpreter;
281-
275+
282276 return [NSString stringWithFormat:
283277 @" cd '%@ ' && '%@ '%s%s%s%s%s%s %@ '%@ ' %@ %s " ,
284278 [self _replaceSingleQuotes: script_dir],
@@ -297,7 +291,7 @@ - (NSString *)commandLineForScript: (NSString *)script
297291
298292- (NSArray *) interpreters { return interpreters;};
299293
300- // FileSettingsSource protocol
294+ // FileSettingsSource protocol
301295- (NSString *) interpreter { return interpreter;};
302296- (BOOL ) honourhashbang { return honourhashbang; };
303297- (BOOL ) debug { return debug;};
0 commit comments