[Python-checkins] python/dist/src/Mac/OSX/PythonLauncher FileSettings.h,1.4,1.5 FileSettings.m,1.6,1.7 MyDocument.h,1.2,1.3 MyDocument.m,1.4,1.5 PreferencesWindowController.m,1.4,1.5

jackjansen@users.sourceforge.net jackjansen@users.sourceforge.net
Fri, 20 Jun 2003 15:21:05 -0700


Update of /cvsroot/python/python/dist/src/Mac/OSX/PythonLauncher
In directory sc8-pr-cvs1:/tmp/cvs-serv13341

Modified Files:
	FileSettings.h FileSettings.m MyDocument.h MyDocument.m 
	PreferencesWindowController.m 
Log Message:
Added a field that allows the user to set sys.argv-style arguments
to the script. Fixes #757544.


Index: FileSettings.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/OSX/PythonLauncher/FileSettings.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** FileSettings.h	17 Feb 2003 15:39:59 -0000	1.4
--- FileSettings.h	20 Jun 2003 22:21:03 -0000	1.5
***************
*** 20,23 ****
--- 20,24 ----
  - (NSString *) others;
  - (BOOL) with_terminal;
+ - (NSString *) scriptargs;
  @end
  
***************
*** 34,37 ****
--- 35,39 ----
      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
  

Index: FileSettings.m
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/OSX/PythonLauncher/FileSettings.m,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** FileSettings.m	17 Feb 2003 15:39:59 -0000	1.6
--- FileSettings.m	20 Jun 2003 22:21:03 -0000	1.7
***************
*** 78,81 ****
--- 78,82 ----
      tabs = source->tabs;
      others = [source->others retain];
+     scriptargs = [source->scriptargs retain];
      with_terminal = source->with_terminal;
      prefskey = source->prefskey;
***************
*** 165,168 ****
--- 166,170 ----
      if (!self) return self;
      interpreters = [fsdefaults->interpreters retain];
+     scriptargs = [@"" retain];
      [self applyUserDefaults: filetype];
      prefskey = [filetype retain];
***************
*** 192,195 ****
--- 194,198 ----
      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
***************
*** 207,210 ****
--- 210,214 ----
              [NSNumber numberWithBool: nosite], @"nosite",
              others, @"others",
+             scriptargs, @"scriptargs",
              [NSNumber numberWithBool: with_terminal], @"with_terminal",
              nil];
***************
*** 236,239 ****
--- 240,245 ----
      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];
***************
*** 261,265 ****
          
      return [NSString stringWithFormat:
!         @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %s",
          cur_interp,
          debug?" -d":"",
--- 267,271 ----
          
      return [NSString stringWithFormat:
!         @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s",
          cur_interp,
          debug?" -d":"",
***************
*** 271,274 ****
--- 277,281 ----
          others,
          script,
+         scriptargs,
          with_terminal? "&& echo Exit status: $? && exit 1" : " &"];
  }
***************
*** 286,289 ****
--- 293,297 ----
  - (BOOL) tabs { return tabs;};
  - (NSString *) others { return others;};
+ - (NSString *) scriptargs { return scriptargs;};
  - (BOOL) with_terminal { return with_terminal;};
  

Index: MyDocument.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/OSX/PythonLauncher/MyDocument.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** MyDocument.h	17 Feb 2003 15:39:59 -0000	1.2
--- MyDocument.h	20 Jun 2003 22:21:03 -0000	1.3
***************
*** 24,27 ****
--- 24,28 ----
      IBOutlet NSTextField *others;
      IBOutlet NSButton *with_terminal;
+     IBOutlet NSTextField *scriptargs;
      IBOutlet NSTextField *commandline;
  

Index: MyDocument.m
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/OSX/PythonLauncher/MyDocument.m,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MyDocument.m	17 Feb 2003 15:39:59 -0000	1.4
--- MyDocument.m	20 Jun 2003 22:21:03 -0000	1.5
***************
*** 61,64 ****
--- 61,65 ----
      [tabs setState: [settings tabs]];
      [others setStringValue: [settings others]];
+     [scriptargs setStringValue: [settings scriptargs]];
      [with_terminal setState: [settings with_terminal]];
      
***************
*** 162,165 ****
--- 163,167 ----
  - (BOOL) tabs { return [tabs state];};
  - (NSString *) others { return [others stringValue];};
+ - (NSString *) scriptargs { return [scriptargs stringValue];};
  - (BOOL) with_terminal { return [with_terminal state];};
  

Index: PreferencesWindowController.m
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/OSX/PythonLauncher/PreferencesWindowController.m,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PreferencesWindowController.m	17 Feb 2003 15:39:59 -0000	1.4
--- PreferencesWindowController.m	20 Jun 2003 22:21:03 -0000	1.5
***************
*** 40,43 ****
--- 40,44 ----
      [others setStringValue: [settings others]];
      [with_terminal setState: [settings with_terminal]];
+     // Not scriptargs, it isn't for preferences
      
      [commandline setStringValue: [settings commandLineForScript: @"<your script here>"]];
***************
*** 85,88 ****
--- 86,90 ----
  - (NSString *) others { return [others stringValue];};
  - (BOOL) with_terminal { return [with_terminal state];};
+ - (NSString *) scriptargs { return @"";};
  
  // Delegates