From d7cccdd591346967d3c0c286b2e7e534435abc12 Mon Sep 17 00:00:00 2001 From: Jack Jansen Date: Fri, 20 Jun 2003 22:21:03 +0000 Subject: [PATCH] Added a field that allows the user to set sys.argv-style arguments to the script. Fixes #757544. --- .../English.lproj/MyDocument.nib/classes.nib | 1 + .../English.lproj/MyDocument.nib/info.nib | 6 +++--- .../English.lproj/MyDocument.nib/objects.nib | Bin 4441 -> 4845 bytes Mac/OSX/PythonLauncher/FileSettings.h | 2 ++ Mac/OSX/PythonLauncher/FileSettings.m | 10 +++++++++- Mac/OSX/PythonLauncher/MyDocument.h | 1 + Mac/OSX/PythonLauncher/MyDocument.m | 2 ++ .../PreferencesWindowController.m | 2 ++ .../PythonLauncher.pbproj/project.pbxproj | 2 +- 9 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib index 7778ff045557..bcdc0cdf0888 100644 --- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib +++ b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib @@ -14,6 +14,7 @@ nosite = NSButton; optimize = NSButton; others = NSTextField; + scriptargs = NSTextField; tabs = NSButton; verbose = NSButton; "with_terminal" = NSButton; diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib index 0630cb935806..e258c7220a47 100644 --- a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib +++ b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib @@ -3,14 +3,14 @@ IBDocumentLocation - 551 90 356 240 0 0 1280 1002 + 398 60 356 240 0 0 1024 746 IBFramework Version - 286.0 + 291.0 IBOpenObjects 5 IBSystem Version - 6I32 + 6L60 diff --git a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib b/Mac/O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.h @@ -19,6 +19,7 @@ - (BOOL) tabs; - (NSString *) others; - (BOOL) with_terminal; +- (NSString *) scriptargs; @end @interface FileSettings : NSObject @@ -33,6 +34,7 @@ BOOL nosite; // -S option: don't import site.py BOOL tabs; // -t option: warn about inconsistent tabs NSString *others; // other options + NSString *scriptargs; // script arguments (not for preferences) BOOL with_terminal; // Run in terminal window FileSettings *origsource; diff --git a/Mac/OSX/PythonLauncher/FileSettings.m b/Mac/OSX/PythonLauncher/FileSettings.m index 7b28daae0177..fc3937b3dcbd 100755 --- a/Mac/OSX/PythonLauncher/FileSettings.m +++ b/Mac/OSX/PythonLauncher/FileSettings.m @@ -77,6 +77,7 @@ nosite = source->nosite; tabs = source->tabs; others = [source->others retain]; + scriptargs = [source->scriptargs retain]; with_terminal = source->with_terminal; prefskey = source->prefskey; if (prefskey) [prefskey retain]; @@ -164,6 +165,7 @@ self = [self initWithFileSettings: fsdefaults]; if (!self) return self; interpreters = [fsdefaults->interpreters retain]; + scriptargs = [@"" retain]; [self applyUserDefaults: filetype]; prefskey = [filetype retain]; return self; @@ -191,6 +193,7 @@ nosite = [source nosite]; tabs = [source tabs]; others = [[source others] retain]; + scriptargs = [[source scriptargs] retain]; with_terminal = [source with_terminal]; // And if this is a user defaults object we also save the // values @@ -206,6 +209,7 @@ [NSNumber numberWithBool: nosite], @"nosite", [NSNumber numberWithBool: nosite], @"nosite", others, @"others", + scriptargs, @"scriptargs", [NSNumber numberWithBool: with_terminal], @"with_terminal", nil]; defaults = [NSUserDefaults standardUserDefaults]; @@ -235,6 +239,8 @@ if (value) tabs = [value boolValue]; value = [dict objectForKey: @"others"]; if (value) others = [value retain]; + value = [dict objectForKey: @"scriptargs"]; + if (value) scriptargs = [value retain]; value = [dict objectForKey: @"with_terminal"]; if (value) with_terminal = [value boolValue]; } @@ -260,7 +266,7 @@ cur_interp = interpreter; return [NSString stringWithFormat: - @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %s", + @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s", cur_interp, debug?" -d":"", verbose?" -v":"", @@ -270,6 +276,7 @@ tabs?" -t":"", others, script, + scriptargs, with_terminal? "&& echo Exit status: $? && exit 1" : " &"]; } @@ -285,6 +292,7 @@ - (BOOL) nosite { return nosite;}; - (BOOL) tabs { return tabs;}; - (NSString *) others { return others;}; +- (NSString *) scriptargs { return scriptargs;}; - (BOOL) with_terminal { return with_terminal;}; @end diff --git a/Mac/OSX/PythonLauncher/MyDocument.h b/Mac/OSX/PythonLauncher/MyDocument.h index dd2b4fe9bde2..00c1bae54e24 100755 --- a/Mac/OSX/PythonLauncher/MyDocument.h +++ b/Mac/OSX/PythonLauncher/MyDocument.h @@ -23,6 +23,7 @@ IBOutlet NSButton *tabs; IBOutlet NSTextField *others; IBOutlet NSButton *with_terminal; + IBOutlet NSTextField *scriptargs; IBOutlet NSTextField *commandline; NSString *script; diff --git a/Mac/OSX/PythonLauncher/MyDocument.m b/Mac/OSX/PythonLauncher/MyDocument.m index 09a0024d5e77..5acc2dcc90c1 100755 --- a/Mac/OSX/PythonLauncher/MyDocument.m +++ b/Mac/OSX/PythonLauncher/MyDocument.m @@ -60,6 +60,7 @@ [nosite setState: [settings nosite]]; [tabs setState: [settings tabs]]; [others setStringValue: [settings others]]; + [scriptargs setStringValue: [settings scriptargs]]; [with_terminal setState: [settings with_terminal]]; [commandline setStringValue: [settings commandLineForScript: script]]; @@ -161,6 +162,7 @@ - (BOOL) nosite { return [nosite state];}; - (BOOL) tabs { return [tabs state];}; - (NSString *) others { return [others stringValue];}; +- (NSString *) scriptargs { return [scriptargs stringValue];}; - (BOOL) with_terminal { return [with_terminal state];}; // Delegates diff --git a/Mac/OSX/PythonLauncher/PreferencesWindowController.m b/Mac/OSX/PythonLauncher/PreferencesWindowController.m index fd65194afce0..5dd08f36927c 100644 --- a/Mac/OSX/PythonLauncher/PreferencesWindowController.m +++ b/Mac/OSX/PythonLauncher/PreferencesWindowController.m @@ -39,6 +39,7 @@ [tabs setState: [settings tabs]]; [others setStringValue: [settings others]]; [with_terminal setState: [settings with_terminal]]; + // Not scriptargs, it isn't for preferences [commandline setStringValue: [settings commandLineForScript: @""]]; } @@ -84,6 +85,7 @@ - (BOOL) tabs { return [tabs state];}; - (NSString *) others { return [others stringValue];}; - (BOOL) with_terminal { return [with_terminal state];}; +- (NSString *) scriptargs { return @"";}; // Delegates - (void)controlTextDidChange:(NSNotification *)aNotification diff --git a/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj b/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj index 107ce3dd4f27..badee8785b5b 100755 --- a/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj +++ b/Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj @@ -132,6 +132,7 @@ 4A9504D0FFE6A4CB11CA0CBA, 4A9504D1FFE6A4CB11CA0CBA, ); + hasScannedForEncodings = 1; isa = PBXProject; mainGroup = 2A37F4AAFDCFA73011CA2CEA; projectDirPath = ""; @@ -385,7 +386,6 @@ "; - shouldUseHeadermap = 0; }; 2A37F4C7FDCFA73011CA2CEA = { buildActionMask = 2147483647; -- 2.47.3