]> granicus.if.org Git - python/commitdiff
Added a field that allows the user to set sys.argv-style arguments
authorJack Jansen <jack.jansen@cwi.nl>
Fri, 20 Jun 2003 22:21:03 +0000 (22:21 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Fri, 20 Jun 2003 22:21:03 +0000 (22:21 +0000)
to the script. Fixes #757544.

Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/classes.nib
Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/info.nib
Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib
Mac/OSX/PythonLauncher/FileSettings.h
Mac/OSX/PythonLauncher/FileSettings.m
Mac/OSX/PythonLauncher/MyDocument.h
Mac/OSX/PythonLauncher/MyDocument.m
Mac/OSX/PythonLauncher/PreferencesWindowController.m
Mac/OSX/PythonLauncher/PythonLauncher.pbproj/project.pbxproj

index 7778ff0455570ec8584ea2b801d3fa1765f80fd9..bcdc0cdf088803793f95d9c568283ff839293cd8 100644 (file)
@@ -14,6 +14,7 @@
                 nosite = NSButton; 
                 optimize = NSButton; 
                 others = NSTextField; 
+                scriptargs = NSTextField; 
                 tabs = NSButton; 
                 verbose = NSButton; 
                 "with_terminal" = NSButton; 
index 0630cb9358069377ebf5e5f8836306441831f74f..e258c7220a4795ffd2ae7da383e2a71098e65057 100644 (file)
@@ -3,14 +3,14 @@
 <plist version="1.0">
 <dict>
        <key>IBDocumentLocation</key>
-       <string>551 90 356 240 0 0 1280 1002 </string>
+       <string>398 60 356 240 0 0 1024 746 </string>
        <key>IBFramework Version</key>
-       <string>286.0</string>
+       <string>291.0</string>
        <key>IBOpenObjects</key>
        <array>
                <integer>5</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>6I32</string>
+       <string>6L60</string>
 </dict>
 </plist>
index 97eb230a29c272ca83ab4fef213f30eb83a562dd..af6decbcda5e9b6ccee2f4e4135ea12818372823 100644 (file)
Binary files a/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib and b/Mac/OSX/PythonLauncher/English.lproj/MyDocument.nib/objects.nib differ
index f70b05f51831a2346b914d24bd0d0fde0d0fa39d..d807bae59cc30ddc38fc9a2cfdda9a19ad5ff662 100755 (executable)
@@ -19,6 +19,7 @@
 - (BOOL) tabs;
 - (NSString *) others;
 - (BOOL) with_terminal;
+- (NSString *) scriptargs;
 @end
 
 @interface FileSettings : NSObject <FileSettingsSource>
@@ -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;
index 7b28daae017782d0fd80bc8a306fc1ec66ceab9f..fc3937b3dcbd7a7b33fdde6f425a9d654a38b078 100755 (executable)
@@ -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];
     self = [self initWithFileSettings: fsdefaults];
     if (!self) return self;
     interpreters = [fsdefaults->interpreters retain];
+    scriptargs = [@"" retain];
     [self applyUserDefaults: filetype];
     prefskey = [filetype retain];
     return self;
     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
             [NSNumber numberWithBool: nosite], @"nosite",
             [NSNumber numberWithBool: nosite], @"nosite",
             others, @"others",
+            scriptargs, @"scriptargs",
             [NSNumber numberWithBool: with_terminal], @"with_terminal",
             nil];
         defaults = [NSUserDefaults standardUserDefaults];
     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];
 }
         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":"",
         tabs?" -t":"",
         others,
         script,
+        scriptargs,
         with_terminal? "&& echo Exit status: $? && exit 1" : " &"];
 }
 
 - (BOOL) nosite { return nosite;};
 - (BOOL) tabs { return tabs;};
 - (NSString *) others { return others;};
+- (NSString *) scriptargs { return scriptargs;};
 - (BOOL) with_terminal { return with_terminal;};
 
 @end
index dd2b4fe9bde21557e2589da8a104bca581668af9..00c1bae54e2492876a3a5e42c18dc247c8d532f7 100755 (executable)
@@ -23,6 +23,7 @@
     IBOutlet NSButton *tabs;
     IBOutlet NSTextField *others;
     IBOutlet NSButton *with_terminal;
+    IBOutlet NSTextField *scriptargs;
     IBOutlet NSTextField *commandline;
 
     NSString *script;
index 09a0024d5e779ba2e8dd4075c56197ef35c3dbda..5acc2dcc90c1e8ee5181a6b5727a7dcf7470813c 100755 (executable)
@@ -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]];
 - (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
index fd65194afce08d1ae20b406eda28ac0e4b5193a2..5dd08f36927c8f912024e6a2489d10169a02c769 100644 (file)
@@ -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: @"<your script here>"]];
 }
@@ -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
index 107ce3dd4f27c23c23f7f866cb9d7c4818628d8d..badee8785b5b176f39f217f7044ccd15328cd95d 100755 (executable)
                                4A9504D0FFE6A4CB11CA0CBA,
                                4A9504D1FFE6A4CB11CA0CBA,
                        );
+                       hasScannedForEncodings = 1;
                        isa = PBXProject;
                        mainGroup = 2A37F4AAFDCFA73011CA2CEA;
                        projectDirPath = "";
 </dict>
 </plist>
 ";
-                       shouldUseHeadermap = 0;
                };
                2A37F4C7FDCFA73011CA2CEA = {
                        buildActionMask = 2147483647;