[Stackless-checkins] CVS: slpdev/src/2.2/src/Mac/OSX/PythonLauncher .cvsignore, NONE, 1.1 FileSettings.h, NONE, 1.1 FileSettings.m, NONE, 1.1 MyAppDelegate.h, NONE, 1.1 MyAppDelegate.m, NONE, 1.1 MyDocument.h, NONE, 1.1 MyDocument.m, NONE, 1.1 PreferencesWindowController.h, NONE, 1.1 PreferencesWindowController.m, NONE, 1.1 PythonCompiled.icns, NONE, 1.1 PythonInterpreter.icns, NONE, 1.1 PythonSource.icns, NONE, 1.1 PythonWSource.icns, NONE, 1.1 doscript.h, NONE, 1.1 doscript.m, NONE, 1.1 factorySettings.plist, NONE, 1.1 main.m, NONE, 1.1

Christian Tismer tismer at centera.de
Sat May 1 02:54:29 CEST 2004


Update of /home/cvs/slpdev/src/2.2/src/Mac/OSX/PythonLauncher
In directory centera.de:/home/tismer/slpdev/src/2.2/src/Mac/OSX/PythonLauncher

Added Files:
	.cvsignore FileSettings.h FileSettings.m MyAppDelegate.h 
	MyAppDelegate.m MyDocument.h MyDocument.m 
	PreferencesWindowController.h PreferencesWindowController.m 
	PythonCompiled.icns PythonInterpreter.icns PythonSource.icns 
	PythonWSource.icns doscript.h doscript.m factorySettings.plist 
	main.m 
Log Message:
added files

--- NEW FILE: .cvsignore ---
build

--- NEW FILE: FileSettings.h ---
//
//  FileSettings.h
//  PythonLauncher
//
//  Created by Jack Jansen on Sun Jul 21 2002.
//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol FileSettingsSource
- (NSString *) interpreter;
- (BOOL) honourhashbang;
- (BOOL) debug;
- (BOOL) verbose;
- (BOOL) inspect;
- (BOOL) optimize;
- (BOOL) nosite;
- (BOOL) tabs;
- (NSString *) others;
- (BOOL) with_terminal;
- (NSString *) scriptargs;
@end

@interface FileSettings : NSObject <FileSettingsSource>
{
    NSString *interpreter;	// The pathname of the interpreter to use
    NSArray *interpreters;	// List of known interpreters
    BOOL honourhashbang;	// #! line overrides interpreter
    BOOL debug;			// -d option: debug parser
    BOOL verbose;		// -v option: verbose import
    BOOL inspect;		// -i option: interactive mode after script
    BOOL optimize;		// -O option: optimize bytecode
    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;
    NSString *prefskey;
}

+ (id)getDefaultsForFileType: (NSString *)filetype;
+ (id)getFactorySettingsForFileType: (NSString *)filetype;
+ (id)newSettingsForFileType: (NSString *)filetype;

//- (id)init;
- (id)initForFileType: (NSString *)filetype;
- (id)initForFSDefaultFileType: (NSString *)filetype;
- (id)initForDefaultFileType: (NSString *)filetype;
//- (id)initWithFileSettings: (FileSettings *)source;

- (void)updateFromSource: (id <FileSettingsSource>)source;
- (NSString *)commandLineForScript: (NSString *)script;

//- (void)applyFactorySettingsForFileType: (NSString *)filetype;
//- (void)saveDefaults;
//- (void)applyUserDefaults: (NSString *)filetype;
- (void)applyValuesFromDict: (NSDictionary *)dict;
- (void)reset;
- (NSArray *) interpreters;

@end

--- NEW FILE: FileSettings.m ---
//
//  FileSettings.m
//  PythonLauncher
//
//  Created by Jack Jansen on Sun Jul 21 2002.
//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//

#import "FileSettings.h"

@implementation FileSettings

+ (id)getFactorySettingsForFileType: (NSString *)filetype
{
    static FileSettings *fsdefault_py, *fsdefault_pyw, *fsdefault_pyc;
    FileSettings **curdefault;
    
    if ([filetype isEqualToString: @"Python Script"]) {
        curdefault = &fsdefault_py;
    } else if ([filetype isEqualToString: @"Python GUI Script"]) {
        curdefault = &fsdefault_pyw;
    } else if ([filetype isEqualToString: @"Python Bytecode Document"]) {
        curdefault = &fsdefault_pyc;
    } else {
        NSLog(@"Funny File Type: %@\n", filetype);
        curdefault = &fsdefault_py;
        filetype = @"Python Script";
    }
    if (!*curdefault) {
        *curdefault = [[FileSettings new] initForFSDefaultFileType: filetype];
    }
    return *curdefault;
}

+ (id)getDefaultsForFileType: (NSString *)filetype
{
    static FileSettings *default_py, *default_pyw, *default_pyc;
    FileSettings **curdefault;
    
    if ([filetype isEqualToString: @"Python Script"]) {
        curdefault = &default_py;
    } else if ([filetype isEqualToString: @"Python GUI Script"]) {
        curdefault = &default_pyw;
    } else if ([filetype isEqualToString: @"Python Bytecode Document"]) {
        curdefault = &default_pyc;
    } else {
        NSLog(@"Funny File Type: %@\n", filetype);
        curdefault = &default_py;
        filetype = @"Python Script";
    }
    if (!*curdefault) {
        *curdefault = [[FileSettings new] initForDefaultFileType: filetype];
    }
    return *curdefault;
}

+ (id)newSettingsForFileType: (NSString *)filetype
{
    FileSettings *cur;
    
    cur = [FileSettings new];
    [cur initForFileType: filetype];
    return [cur retain];
}

- (id)initWithFileSettings: (FileSettings *)source
{
    self = [super init];
    if (!self) return self;
    
    interpreter = [source->interpreter retain];
    honourhashbang = source->honourhashbang;
    debug = source->debug;
    verbose = source->verbose;
    inspect = source->inspect;
    optimize = source->optimize;
    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];
    
    return self;
}

- (id)initForFileType: (NSString *)filetype
{
    FileSettings *defaults;
    
    defaults = [FileSettings getDefaultsForFileType: filetype];
    self = [self initWithFileSettings: defaults];
    origsource = [defaults retain];
    return self;
}

//- (id)init
//{
//    self = [self initForFileType: @"Python Script"];
//    return self;
//}

- (id)initForFSDefaultFileType: (NSString *)filetype
{
    int i;
    NSString *filename;
    NSDictionary *dict;
    static NSDictionary *factorySettings;
    
    self = [super init];
    if (!self) return self;
    
    if (factorySettings == NULL) {
        NSBundle *bdl = [NSBundle mainBundle];
        NSString *path = [ bdl pathForResource: @"factorySettings"
                ofType: @"plist"];
        factorySettings = [[NSDictionary dictionaryWithContentsOfFile:
            path] retain];
        if (factorySettings == NULL) {
            NSLog(@"Missing %@", path);
            return NULL;
        }
    }
    dict = [factorySettings objectForKey: filetype];
    if (dict == NULL) {
        NSLog(@"factorySettings.plist misses file type \"%@\"", filetype);
        interpreter = [@"no default found" retain];
        return NULL;
    }
    [self applyValuesFromDict: dict];
    interpreters = [dict objectForKey: @"interpreter_list"];
    interpreter = NULL;
    for (i=0; i < [interpreters count]; i++) {
        filename = [interpreters objectAtIndex: i];
        filename = [filename stringByExpandingTildeInPath];
        if ([[NSFileManager defaultManager] fileExistsAtPath: filename]) {
            interpreter = [filename retain];
            break;
        }
    }
    if (interpreter == NULL)
        interpreter = [@"no default found" retain];
    origsource = NULL;
    return self;
}

- (void)applyUserDefaults: (NSString *)filetype
{
    NSUserDefaults *defaults;
    NSDictionary *dict;
    
    defaults = [NSUserDefaults standardUserDefaults];
    dict = [defaults dictionaryForKey: filetype];
    if (!dict)
        return;
    [self applyValuesFromDict: dict];
}
    
- (id)initForDefaultFileType: (NSString *)filetype
{
    FileSettings *fsdefaults;
    
    fsdefaults = [FileSettings getFactorySettingsForFileType: filetype];
    self = [self initWithFileSettings: fsdefaults];
    if (!self) return self;
    interpreters = [fsdefaults->interpreters retain];
    scriptargs = [@"" retain];
    [self applyUserDefaults: filetype];
    prefskey = [filetype retain];
    return self;
}

- (void)reset
{
    if (origsource) {
        [self updateFromSource: origsource];
    } else {
        FileSettings *fsdefaults;
        fsdefaults = [FileSettings getFactorySettingsForFileType: prefskey];
        [self updateFromSource: fsdefaults];
    }
}

- (void)updateFromSource: (id <FileSettingsSource>)source
{
    interpreter = [[source interpreter] retain];
    honourhashbang = [source honourhashbang];
    debug = [source debug];
    verbose = [source verbose];
    inspect = [source inspect];
    optimize = [source optimize];
    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
    if (!origsource) {
        NSUserDefaults *defaults;
        NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
            interpreter, @"interpreter",
            [NSNumber numberWithBool: honourhashbang], @"honourhashbang",
            [NSNumber numberWithBool: debug], @"debug",
            [NSNumber numberWithBool: verbose], @"verbose",
            [NSNumber numberWithBool: inspect], @"inspect",
            [NSNumber numberWithBool: optimize], @"optimize",
            [NSNumber numberWithBool: nosite], @"nosite",
            [NSNumber numberWithBool: nosite], @"nosite",
            others, @"others",
            scriptargs, @"scriptargs",
            [NSNumber numberWithBool: with_terminal], @"with_terminal",
            nil];
        defaults = [NSUserDefaults standardUserDefaults];
        [defaults setObject: dict forKey: prefskey];
    }
}

- (void)applyValuesFromDict: (NSDictionary *)dict
{
    id value;
    
    value = [dict objectForKey: @"interpreter"];
    if (value) interpreter = [value retain];
    value = [dict objectForKey: @"honourhashbang"];
    if (value) honourhashbang = [value boolValue];
    value = [dict objectForKey: @"debug"];
    if (value) debug = [value boolValue];
    value = [dict objectForKey: @"verbose"];
    if (value) verbose = [value boolValue];
    value = [dict objectForKey: @"inspect"];
    if (value) inspect = [value boolValue];
    value = [dict objectForKey: @"optimize"];
    if (value) optimize = [value boolValue];
    value = [dict objectForKey: @"nosite"];
    if (value) nosite = [value boolValue];
    value = [dict objectForKey: @"nosite"];
    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];
}

- (NSString *)commandLineForScript: (NSString *)script
{
    NSString *cur_interp = NULL;
    char hashbangbuf[1024];
    FILE *fp;
    char *p;
    
    if (honourhashbang &&
       (fp=fopen([script cString], "r")) &&
       fgets(hashbangbuf, sizeof(hashbangbuf), fp) &&
       strncmp(hashbangbuf, "#!", 2) == 0 &&
       (p=strchr(hashbangbuf, '\n'))) {
            *p = '\0';
            p = hashbangbuf + 2;
            while (*p == ' ') p++;
            cur_interp = [NSString stringWithCString: p];
    }
    if (!cur_interp)
        cur_interp = interpreter;
        
    return [NSString stringWithFormat:
        @"\"%@\"%s%s%s%s%s%s %@ \"%@\" %@ %s",
        cur_interp,
        debug?" -d":"",
        verbose?" -v":"",
        inspect?" -i":"",
        optimize?" -O":"",
        nosite?" -S":"",
        tabs?" -t":"",
        others,
        script,
        scriptargs,
        with_terminal? "&& echo Exit status: $? && exit 1" : " &"];
}

- (NSArray *) interpreters { return interpreters;};

// FileSettingsSource protocol 
- (NSString *) interpreter { return interpreter;};
- (BOOL) honourhashbang { return honourhashbang; };
- (BOOL) debug { return debug;};
- (BOOL) verbose { return verbose;};
- (BOOL) inspect { return inspect;};
- (BOOL) optimize { return optimize;};
- (BOOL) nosite { return nosite;};
- (BOOL) tabs { return tabs;};
- (NSString *) others { return others;};
- (NSString *) scriptargs { return scriptargs;};
- (BOOL) with_terminal { return with_terminal;};

@end

--- NEW FILE: MyAppDelegate.h ---
/* MyAppDelegate */

#import <Cocoa/Cocoa.h>

@interface MyAppDelegate : NSObject
{
    BOOL	initial_action_done;
    BOOL	should_terminate;
}
- (id)init;
- (IBAction)showPreferences:(id)sender;
- (BOOL)shouldShowUI;
- (BOOL)shouldTerminate;
- (void)testFileTypeBinding;
@end

--- NEW FILE: MyAppDelegate.m ---
#import "MyAppDelegate.h"
#import "PreferencesWindowController.h"
#import <Carbon/Carbon.h>
#import <ApplicationServices/ApplicationServices.h>

@implementation MyAppDelegate

- (id)init
{
    self = [super init];
    initial_action_done = NO;
    should_terminate = NO;
    return self;
}

- (IBAction)showPreferences:(id)sender
{
    [PreferencesWindowController getPreferencesWindow];
}

- (void)applicationDidFinishLaunching:(NSNotification *)notification
{
    // Test that the file mappings are correct
    [self testFileTypeBinding];
    // If we were opened because of a file drag or doubleclick
    // we've set initial_action_done in shouldShowUI
    // Otherwise we open a preferences dialog.
    if (!initial_action_done) {
        initial_action_done = YES;
        [self showPreferences: self];
    }
}

- (BOOL)shouldShowUI
{
    // if this call comes before applicationDidFinishLaunching: we 
    // should terminate immedeately after starting the script.
    if (!initial_action_done)
        should_terminate = YES;
    initial_action_done = YES;
    if( GetCurrentKeyModifiers() & optionKey )
        return YES;
    return NO;
}

- (BOOL)shouldTerminate
{
    return should_terminate;
}

- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
{
    return NO;
}

- (void)testFileTypeBinding
{
    NSURL *ourUrl;
    OSStatus err;
    FSRef appRef;
    NSURL *appUrl;
    static NSString *extensions[] = { @"py", @"pyw", @"pyc", NULL};
    NSString **ext_p;
    int i;
    
    if ([[NSUserDefaults standardUserDefaults] boolForKey: @"SkipFileBindingTest"])
        return;
    ourUrl = [NSURL fileURLWithPath: [[NSBundle mainBundle] bundlePath]];
    for( ext_p = extensions; *ext_p; ext_p++ ) {
        err = LSGetApplicationForInfo(
            kLSUnknownType,
            kLSUnknownCreator,
            (CFStringRef)*ext_p,
            kLSRolesViewer,
            &appRef,
            (CFURLRef *)&appUrl);
        if (err || ![appUrl isEqual: ourUrl] ) {
            i = NSRunAlertPanel(@"File type binding",
                @"PythonLauncher is not the default application for all " \
                  @"Python script types. You should fix this with the " \
                  @"Finder's \"Get Info\" command.\n\n" \
                  @"See \"Changing the application that opens a file\" in " \
                  @"Mac Help for details.",
                @"OK",
                @"Don't show this warning again",
                NULL);
            if ( i == 0 ) { // Don't show again
                [[NSUserDefaults standardUserDefaults]
                    setObject:@"YES" forKey:@"SkipFileBindingTest"];
            }
            return;
        }
    }
}
        
@end

--- NEW FILE: MyDocument.h ---
//
//  MyDocument.h
//  PythonLauncher
//
//  Created by Jack Jansen on Fri Jul 19 2002.
//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//


#import <Cocoa/Cocoa.h>

#import "FileSettings.h"

@interface MyDocument : NSDocument <FileSettingsSource>
{
    IBOutlet NSTextField *interpreter;
    IBOutlet NSButton *honourhashbang;
    IBOutlet NSButton *debug;
    IBOutlet NSButton *verbose;
    IBOutlet NSButton *inspect;
    IBOutlet NSButton *optimize;
    IBOutlet NSButton *nosite;
    IBOutlet NSButton *tabs;
    IBOutlet NSTextField *others;
    IBOutlet NSButton *with_terminal;
    IBOutlet NSTextField *scriptargs;
    IBOutlet NSTextField *commandline;

    NSString *script;
    NSString *filetype;
    FileSettings *settings;
}

- (IBAction)do_run:(id)sender;
- (IBAction)do_cancel:(id)sender;
- (IBAction)do_reset:(id)sender;
- (IBAction)do_apply:(id)sender;

- (void)controlTextDidChange:(NSNotification *)aNotification;

@end

--- NEW FILE: MyDocument.m ---
//
//  MyDocument.m
//  PythonLauncher
//
//  Created by Jack Jansen on Fri Jul 19 2002.
//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//

#import "MyDocument.h"
#import "MyAppDelegate.h"
#import "doscript.h"

@implementation MyDocument

- (id)init
{
    self = [super init];
    if (self) {
    
        // Add your subclass-specific initialization here.
        // If an error occurs here, send a [self dealloc] message and return nil.
        script = [@"<no script>.py" retain];
        filetype = [@"Python Script" retain];
        settings = NULL;
    }
    return self;
}

- (NSString *)windowNibName
{
    // Override returning the nib file name of the document
    // If you need to use a subclass of NSWindowController or if your document supports multiple NSWindowControllers, you should remove this method and override -makeWindowControllers instead.
    return @"MyDocument";
}

- (void)close
{
    NSApplication *app = [NSApplication sharedApplication];
    [super close];
    if ([[app delegate] shouldTerminate])
        [app terminate: self];
}

- (void)load_defaults
{
//    if (settings) [settings release];
    settings = [FileSettings newSettingsForFileType: filetype];
}

- (void)update_display
{
//    [[self window] setTitle: script];
    
    [interpreter setStringValue: [settings interpreter]];
    [honourhashbang setState: [settings honourhashbang]];
    [debug setState: [settings debug]];
    [verbose setState: [settings verbose]];
    [inspect setState: [settings inspect]];
    [optimize setState: [settings optimize]];
    [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]];
}

- (void)update_settings
{
    [settings updateFromSource: self];
}

- (BOOL)run
{
    const char *cmdline;
    int sts;
    
     cmdline = [[settings commandLineForScript: script] cString];
   if ([settings with_terminal]) {
        sts = doscript(cmdline);
    } else {
        sts = system(cmdline);
    }
    if (sts) {
        NSLog(@"Exit status: %d\n", sts);
        return NO;
    }
    return YES;
}

- (void)windowControllerDidLoadNib:(NSWindowController *) aController
{
    [super windowControllerDidLoadNib:aController];
    // Add any code here that need to be executed once the windowController has loaded the document's window.
    [self load_defaults];
    [self update_display];
}

- (NSData *)dataRepresentationOfType:(NSString *)aType
{
    // Insert code here to write your document from the given data.  You can also choose to override -fileWrapperRepresentationOfType: or -writeToFile:ofType: instead.
    return nil;
}

- (BOOL)readFromFile:(NSString *)fileName ofType:(NSString *)type;
{
    // Insert code here to read your document from the given data.  You can also choose to override -loadFileWrapperRepresentation:ofType: or -readFromFile:ofType: instead.
    BOOL show_ui;
    
    // ask the app delegate whether we should show the UI or not. 
    show_ui = [[[NSApplication sharedApplication] delegate] shouldShowUI];
    [script release];
    script = [fileName retain];
    [filetype release];
    filetype = [type retain];
//    if (settings) [settings release];
    settings = [FileSettings newSettingsForFileType: filetype];
    if (show_ui) {
        [self update_display];
        return YES;
    } else {
        [self run];
        [self close];
        return NO;
    }
}

- (IBAction)do_run:(id)sender
{
    [self update_settings];
    [self update_display];
    if ([self run])
        [self close];
}

- (IBAction)do_cancel:(id)sender
{
    [self close];
}


- (IBAction)do_reset:(id)sender
{
    [settings reset];
    [self update_display];
}

- (IBAction)do_apply:(id)sender
{
    [self update_settings];
    [self update_display];
}

// FileSettingsSource protocol 
- (NSString *) interpreter { return [interpreter stringValue];};
- (BOOL) honourhashbang { return [honourhashbang state];};
- (BOOL) debug { return [debug state];};
- (BOOL) verbose { return [verbose state];};
- (BOOL) inspect { return [inspect state];};
- (BOOL) optimize { return [optimize state];};
- (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
- (void)controlTextDidChange:(NSNotification *)aNotification
{
    [self update_settings];
    [self update_display];
};

@end

--- NEW FILE: PreferencesWindowController.h ---
/* PreferencesWindowController */

#import <Cocoa/Cocoa.h>

#import "FileSettings.h"

@interface PreferencesWindowController : NSWindowController <FileSettingsSource>
{
    IBOutlet NSPopUpButton *filetype;
    IBOutlet NSTextField *interpreter;
    IBOutlet NSButton *honourhashbang;
    IBOutlet NSButton *debug;
    IBOutlet NSButton *verbose;
    IBOutlet NSButton *inspect;
    IBOutlet NSButton *optimize;
    IBOutlet NSButton *nosite;
    IBOutlet NSButton *tabs;
    IBOutlet NSTextField *others;
    IBOutlet NSButton *with_terminal;
    IBOutlet NSTextField *commandline;

    FileSettings *settings;
}

+ getPreferencesWindow;

- (IBAction)do_reset:(id)sender;
- (IBAction)do_apply:(id)sender;
- (IBAction)do_filetype:(id)sender;

- (void)controlTextDidChange:(NSNotification *)aNotification;

- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString;
- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index;
- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox;


@end

--- NEW FILE: PreferencesWindowController.m ---
#import "PreferencesWindowController.h"

@implementation PreferencesWindowController

+ getPreferencesWindow
{
    static PreferencesWindowController *_singleton;
    
    if (!_singleton)
        _singleton = [[PreferencesWindowController alloc] init];
    [_singleton showWindow: _singleton];
    return _singleton;
}

- (id) init
{
    self = [self initWithWindowNibName: @"PreferenceWindow"];
    return self;
}

- (void)load_defaults
{
    NSString *title = [filetype titleOfSelectedItem];
    
    settings = [FileSettings getDefaultsForFileType: title];
}

- (void)update_display
{
//    [[self window] setTitle: script];
    
    [interpreter setStringValue: [settings interpreter]];
    [honourhashbang setState: [settings honourhashbang]];
    [debug setState: [settings debug]];
    [verbose setState: [settings verbose]];
    [inspect setState: [settings inspect]];
    [optimize setState: [settings optimize]];
    [nosite setState: [settings nosite]];
    [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>"]];
}

- (void) windowDidLoad
{
    [super windowDidLoad];
    [self load_defaults];
    [self update_display];
}

- (void)update_settings
{
    [settings updateFromSource: self];
}

- (IBAction)do_filetype:(id)sender
{
    [self load_defaults];
    [self update_display];
}

- (IBAction)do_reset:(id)sender
{
    [settings reset];
    [self update_display];
}

- (IBAction)do_apply:(id)sender
{
    [self update_settings];
    [self update_display];
}

// FileSettingsSource protocol 
- (NSString *) interpreter { return [interpreter stringValue];};
- (BOOL) honourhashbang { return [honourhashbang state]; };
- (BOOL) debug { return [debug state];};
- (BOOL) verbose { return [verbose state];};
- (BOOL) inspect { return [inspect state];};
- (BOOL) optimize { return [optimize state];};
- (BOOL) nosite { return [nosite state];};
- (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
{
    [self update_settings];
    [self update_display];
};

// NSComboBoxDataSource protocol
- (unsigned int)comboBox:(NSComboBox *)aComboBox indexOfItemWithStringValue:(NSString *)aString
{
    return [[settings interpreters] indexOfObjectIdenticalTo: aString];
}

- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)index
{
    return [[settings interpreters] objectAtIndex: index];
}

- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox
{
    return [[settings interpreters] count];
}


@end

--- NEW FILE: PythonCompiled.icns ---
icns
	"räáßÞÙÔ¿Ô„
sæÞÛÚØÒË™vÄ€

uðÍçååÇâçæá܁
	"rãàßÞÙÔ¿Ô„
sæÞÛÚ×ÒÊšvÄ€

uðÍçååÇâçæá܁
	"räáßÞÙÔ¿Ô„
sæÞÛÚ×ÒʘuÄ€

uðÍçååÇâçæáہ
âàÞÛØÖÓÐƸ§Ž


÷öæðìßÏËßØäƒ3ßËíìî‡
úøØõôôñÖÕÒ4ƒ3Jâòóó‡
3íîìèæäãâàà€ßÞÝàãâßÝÙÒ‡


÷öæðìßÏËß»â‚
úøØõôôñÖÕɃ
3íîìèæäãâàà€ßÞÝßãâßÝÙÒ‡


÷öæðìßÏËßÏ郙Ô·íìí‡
ùøØõôôñÖÕÏšƒ™£Ùñóó‡
uèèåâàÞÝÜÛÛ€ÚØ×ÖÔÒÐÏÊ¿¥™‡xuŒ¬ÄZ
"
ÜÛÚÙ×ÖÔÒÐÍÌ€ÊǾ·²‹


çêêéçæåãáßÞ‹
xøø÷öõôôòòñ€ðÓ©î3342433¹é½Èêëììî‹
"
VYb{›¼Ýîöùò‹
Ž’Ÿ±Èáðõùó‹
sèèåâàÞÝÜÛÛ€ÚØ×ÖÔÒÐÏʾ¦š…ywŒ¬ÄZ
"
ÜÛÚÙØÖÓÒÐÏÌ€ÊǾ·²‹


çêêéåæåãâßÞ‹
"
VYb{›¼Ýîöùò‹
Ž’Ÿ±Èáðõùó‹
sèèåâàÞÝÜÛÛ€ÚØ×ÖÔÒÐÏÊ¿¦™ˆyuŒ¬ÄZ
"
zìêéçäâàßÞށÝ
ÜÛÚÙ×ÕÔÒÐÏÌ€ÊǾ·²‹


çêêéçæåãáßÞ‹
xøø÷öõôóòòñ€ðÃ~˜šš™šÔ颳êëììï‹
"
VYb{›¼Ýîöùò‹
Ž’Ÿ±Èáðõùó‹
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
óóô
××ÖÖÕÔÔÓÒÑЀπÎ
ÌÊžµ« š¤ìþ‚ÿúôíåÝÓʹ
âáâßáÞÞßÜÜ߀ÛÚÞÚÚÞÚÙÝ€Ù
ØØ××ÖÖÕÕÔÓÒÑÐЁÏ
ÎÍÊÆ¿¶¬¡«äúþþÿúôíåÝÓʹ›
óóô
ãââáâàßáÞÞá€Ý
ÞßáâÞÝÞáßÞ݁܁ÛÚÚ€ÙØ×ÖÖ€Õ"ÔÓÒÐÏÍËÉÆÃÀ½»º¹¸¸¹¹ºº¹¸¶µ³²°¯®¬¬«®W¤
ÒÏÍÌÉÇÄÁ¾º¸¤
òñ
äããäåãáâäãáà‚߀ހÝÞßáã‚äãââáààßÞÞÝÜÛÚÚÙ×ÕÒÐÐÿ£
粨»ÏÊ®¨Íêê‚ë€êÞÓè€é€èçææååããÿ£
óóô
ÑçèèéÕ¾æèàá€éêêëêéèëÿÿ
QÂçé麙âéÏÒ€êëë‚ìëìï¤
šÖﵜïîîÕ†4ƒ3433234ƒ3J±åé鸙áèÁÆêê€ëƒìíñ¤
óóô
óðóóðòòïòòï€ò	ññ™ÎñàÑñØ\“3	23¢áßÌëꢩ€í€îíìîïïîð‘
554332EÍðòó‚ôõôœ
ñúûúùöôö÷öö€õ‹ôƒõö#Íj23[è­=Äw1535¥õüÈG|çÆ!†ÜáÜB#/<¨ç€ôõööõö€õ
šã(43¨Ýà¡CùR¬Ð7(í•)45‡Üƒö÷÷ö÷€ö
æåäãâáààßàà‚߁à€ßÞÝÜہÚÙØØ××ÖÖÕÔÔÓÑÏÏËÈÿº³®§¢¬ÈŸ½
æääãâáààßÞÞ‚ÝÞނ߀Þ"ÝÜÜÛÛÚÚÙÙØØ××ÖÕÔÔÓÒÑÏÌÉÅÁº²¬¤›•ªÓÊž©
óóô
™ËÈ’¼³~›‘–û€ÿúôíåÝÓʝŸ
âáâßáÞÞßÜÜ߀ÛÚÞÚÚÞÚÙÝÚÙÙØØ××ÖÖÕÕÔÓÒÑЂÏÎÍÉž¶¬¢œ®âúûýþ€ÿúôíåÝÓʹ›
××ÖÖÕÔÓÓÒÑЁÏÎÍÉƾ·­¤Ÿ¨ÌßæíôûûþþúôíåÝÓʹ«
óóô
ãââáâàßáÞÞá€Ý
ÒÏÎÌÉÇÄÁ¾º¸¤
òñ
棚¯ÈÀŸ˜Äêêƒëêêɤæ€é€èçææåäããÿ£
Ûééèéƒèççæåäã¤
Ù¯êê¯Ü	
óóô

Üèèé鸁äéÎЁé‚êéèçèÿ
F´€º¹Êçèèé¯lãèÎЀéêêëêéèéÿÿ
òñóïòòïññðî€ð
'¸æéé_
ªïLïîîÎj
óóô
´ð¼1’
óðóóðòòïòòï€ò	ññ
óðóóðóòïòòï‚ò
—
™
ÁE
æåäãâáààßßà€ßƒà€ßÞÝÜہÚÙØØ××ÖÖÕÔÔÓÑÏÏËÈÿº³®§¢¬ÈŸ½
óóô
¥ÜÜÛ¤Ú̱ÙÙ£€Ø(ס×סÖÕ ÔӝÑÑÐÏšËÊÉË™ËÈ’¼²}™Ž”ýÿÿúôíåÝÓʝ²
šÌÈ“½´’•÷ÿúôíåÝÓʹŸ
ÍËÅ¿·¬ ˜¥ìý‚ÿúôíåÝÓʹ
âáâßáÞÞßÜÜ߀ÛÚÞÚÚÞÚÙÝÚÙÙØØ××ÖÖÕÕÔÓÒÑЂÏÎÍÊÆ¿¸­¡œªàùƒÿúôíåÝÓʹ›
××ÖÖÕÔÓÓÒÑЁÏÎÌÊÅ¿·­¤ž¨Éáçð÷üüþÿùôíåÝÓʹ«
óóô
ãââáâàßáÞÞá€Ý
òñ
ßÞßßÞßÞãèéêƒë
êÝÍèéèèççææ€åäãââáߤ
óòòñððïïîíí‚ì„ëêÞçêâÙ€êÓÀçé
èÙÙÐÈÊÕ×àéêƒëêêÚÈèéé€èçç€æåäããââÿ£
óóô
óóô
š™š³ëñð·½ññ€òóóôôóóòòœ
òûûúùöôö÷öö€õ‹ôƒõö#â´™™{>‘,eš«˜™—D*Šºb,¦ªZŽ¥œœÐñ€ô‚õöõö€õ
ðùúúùùø÷öõõ€ô‰ó‚ôõöõÙ£€™ ›)<„ˆÂL¡˜™A¬ªGÀŒ>#–¢
P ™™Áêƒö÷÷ö÷ööõô







--- NEW FILE: PythonInterpreter.icns ---
icns
"



äÿÿÿÿÿÿÿÿÿÿÿÿÿÍB

*Ej‘¶ÒäîòðêÛáyS2

Iœžq”






#4Oi†§¿ÓæñøüþþÿÿÿýüùñçØÀ¨ŒkQ9"

ÜÑÇÔÜ
ðÖÍÚð
ÖÔÇÕÖ
ÚÒÂÑÚ
ÜοÑÜ
ÜοÑÜ
ÞõÆÞ
ß° ´ß
Û¦™©Û
Ü¥™ªÜ
ݤ™§Ý
Ú¡™§Ú
Û¢™¤Û
ÜŸ™¥Ü
Ú¡™¢Ú
Ú ™ Ú
á ™£á
ÞÌÉÝ
;ÌÔª
8xÌП
8r»ÍÌ
2k¯Ì¿
2fªÌð
24H€ÃÌŸÿŸÄ̱
3¦üÖ_3

3¦üÖ^2
ªª?ªŸª¹ÈÔÎÔ€ÓÎÌǼ¸°ª£œ•‘ˆ{vojfb^ZXVUQPONN‚M)NNOOQRTVX[^cgmqv~‡‹‘™Ÿª­µ»ÀÅÌ×ÐÕ××ÐÔ‘ÌÌ£
z
y
ЗxœÐ
t
᪇«á
n
g
Ѝg™Ð
ÍtKzÍ
¿BJ¿
¸'

¹$
· 
¶
³
±
±
±
´
ƒW
¢K=„
`탻

W»ÈŸ
NªÇÌ
…
!w‘¥
ªª?ªŸª¹ÈÔÎÔ€ÓÎÌǼ¸°ª£œ•‘ˆ{vojfb^ZXVUQPONN‚M)NNOOQRTVX[^cgmqv~‡‹‘™Ÿª­µ»ÀÅÌ×ÐÕ××ÐÔ‘ÌÌ£
àØÞ×Óʾ»»ÄÍ€×Ü֐
п«ÁÐ
ðÆ´Éð
ÖÁ­ÃÖ
ξ¤¿Î
й¡¼Ð
й¡¼Ð
Õª®Õ
Ô‹s‘Ô
Ó|fÓ
ÏyfÏ
Ñyf}Ñ
Îxf|Î
ÏwfyÏ
ÌrfxÌ
ËpfwË
ËpewË
T™™qL39o¨À³‚™'ŒoF
Jƒ‚q}ƒ™{<
€
u™E&w€™Dq™Ÿ™š™¶ÓÝ¥
J
ªª?ªŸª¹ÈÔÎÔ€ÓÎÌǼ¸°ª£œ•‘ˆ{vojfb^ZXVUQPONN‚M)NNOOQRTVX[^cgmqv~‡‹‘™Ÿª­µ»ÀÅÌ×ÐÕ××ÐÔ‘ÌÌ£



											
/A,

1D.

1D.

1D.








…ëÿÿÿÿÿÿÿÿÿÿÿÿÍU










1E/


*M­óÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿá‰D
&`¥ÝûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõÊ‘I
8XB


"&),03579;<<<<;9752/,(%"


#&*.37:>BEHJLMMMMKJGEA=962-)%!
	
 $).4:?FLRX^djpuzƒ†‰‹ŒŒŒŒŠˆ…}ysnhb\VPJC>82-(#
	
#(.4:@GMT[bhov{‚‡Œ”—šœžž›™–“Š…€zsmf`YRKE>82,'"

 &,2:AIQYbks{ƒ‹’š §¬±µº½ÀÂÄÅÅÅÄÿ¼¹µ°ª¤ž—ˆ€xph_WNF?70*$	




!'.5?GQ\gr}‰”Ÿ©´¾ÆÏÕÜâçìðóöøúûüýþþþÿÿÿÿÿÿÿÿþþýýüûù÷õñïêæàÚÔ̹°¦›„yncXND<3+%	

 &,4=FOZdoz†‘œ§±»ÃËÓÚáæëïòõøùûüüýþþþÿÿÿÿÿÿÿÿþþýýüüúù÷ôñíéäßØÑÈÀ¸®£—Œvk`VLB91)"	

#*2:DNXbmx‚Ž˜£®·ÁÉÑÙßåéíñôöøùûüüýýþþþþþþþþþþþþýýüûúù÷õóðìèãÝÖÏǾµ« •Šti^RH?7/'!

 %-4=FOZdoz…›¥¯¹ÁÉÐ×Ýâæêíðòóôõö÷÷øøøøøøøøøøøøøøøø÷÷öõôóñïìéåàÛÕÎƾµ¬¢—Œvk`VLB:1*#	

$+2:BLU_it~ˆ’œ¥®¶½ÄÊÏÔ×ÛÞàâãååææççççççççççççççççççççææåäãâßÝÚÖÒÎÈÁ»³«¢™…zpf[RH?7/("	

$+2:BKU^hq{…Ž—Ÿ§®µ»ÀÅÉÌÏÒÔÕ×ØØÙÙÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÚÙÙØ×ÖÕÓÑÎËÈÄ¿¹³¬¤”‹xnd[QH?7/("	

#)08?GOXajr{ƒ‹“™Ÿ¦ª¯³¶¹»½¿ÀÁÁÂÂÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÄÃÂÂÂÀ¿¾½º¸µ²­©£—ˆxpg^UME=5.'!	
!&,3:AIPX`hov}„‰”˜œŸ¢¤¦¨©ª««¬¬¬­­­­­­­­­­­­­­­­­­­­¬¬¬«ªª¨§¥£¡ž›—’‡‚{tme^VNF?81*$	


	
 !#$%&''(()))))))))))))))))))))))))))))))))))(((''&&%$#"!

	
--- NEW FILE: PythonSource.icns ---
icns
àÞÜÚØÖÓÐƸ§Ž
45"5#2435 €öõô‹
¨˜˜¥—¤˜™˜™Í€öõô‹
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ãââáààßÞÝÝܤ
èßðññðñðÞÛÜ€ÛÚæïîíí€ìãØéêéèèçææåääãâááàߤ
ðÌÅÏÚÖÈÃÛðïî
™Ôõ·›ôõõä5…301432‚3RÊðòò½™èðÓ×ï€îíìëëê€é
šÚõ·œõõôÛŠ5ƒ3433234ƒ3K·îòò»™èïÄÉðï€îíììëê€é¤
õ¢ãõ¶œõõòËn3
@žæñò»˜éð¦­ðïï€î
4nÏòÕ©íç½òñïѯÐîíìì
23†Öíäòñ ©ó€òñððïîî
šã(43¨Ýà¡CùR¬Ð7(í•)45‡Ü‚ö…õ
ãââáààßÞÝÝܤ
ð»ÆÕѽ¸×ððî
Þë€êéèèçææåääããá¤
Þððïïá



®õNõõôÔn
JÇò‹0åÂAaòñïѯÐîíìì
—
ÜÜÝÜÛÛÚØÙÙ×€ÖÕÕÔ€ÒÑÐÐÎÍÉÆÄÀ¾¼¹µ²¯«vÄ
ãââáààßÞÝÝܤ
ñààØÏÑÜÝçððî
fÁõ˜jÖ´³¤™šŽ™š™ ÈÓ±œfäÃvˆðáïïßßЮ€ìëê¤
šµäó²‚êÃ…žòñðѯÐîíìì
š™š³îôó¹¿ôô„óòòññœ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ





--- NEW FILE: PythonWSource.icns ---
icns
45"5#2435 €öõô‹
¨˜˜¥—¤˜™˜™Í€öõô‹
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ãââáààßÞÝÝܤ
èßðññðñðÞÛÜ€ÛÚæïîíí€ìãØéêéèèçææåääãâááàߤ
ðÌÅÏÚÖÈÃÛðïî
™Ôõ·›ôõõä5…301432‚3RÊðòò½™èðÓ×ï€îíìëëê€é
šÚõ·œõõôÛŠ5ƒ3433234ƒ3K·îòò»™èïÄÉðï€îíììëê€é¤
õ¢ãõ¶œõõòËn3
@žæñò»˜éð¦­ðïï€î
4nÏòÕ©íç½òñïѯÐîíìì
23†Öíäòñ ©ó€òñððïîî
šã(43¨Ýà¡CùR¬Ð7(í•)45‡Ü‚ö…õ
ãââáààßÞÝÝܤ
ð»ÆÕѽ¸×ððî
Þë€êéèèçææåääããá¤
Þððïïá



®õNõõôÔn
JÇò‹0åÂAaòñïѯÐîíìì
—
ãââáààßÞÝÝܤ
ñààØÏÑÜÝçððî
fÁõ˜jÖ´³¤™šŽ™š™ ÈÓ±œfäÃvˆðáïïßßЮ€ìëê¤
šµäó²‚êÃ…žòñðѯÐîíìì
š™š³îôó¹¿ôô„óòòññœ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ





--- NEW FILE: doscript.h ---
/*
 *  doscript.h
 *  PythonLauncher
 *
 *  Created by Jack Jansen on Wed Jul 31 2002.
 *  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
 *
 */

#include <Carbon/Carbon.h>

extern int doscript(const char *command);
--- NEW FILE: doscript.m ---
/*
 *  doscript.c
 *  PythonLauncher
 *
 *  Created by Jack Jansen on Wed Jul 31 2002.
 *  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
 *
 */

#import <Cocoa/Cocoa.h>
#import <ApplicationServices/ApplicationServices.h>
#import "doscript.h"

/* I assume I could pick these up from somewhere, but where... */
#define CREATOR 'trmx'

#define ACTIVATE_CMD 'misc'
#define ACTIVATE_SUITE 'actv'

#define DOSCRIPT_CMD 'dosc'
#define DOSCRIPT_SUITE 'core'
#define WITHCOMMAND 'cmnd'

/* ... and there's probably also a better way to do this... */
#define START_TERMINAL "/Applications/Utilities/Terminal.app/Contents/MacOS/Terminal &"

extern int 
doscript(const char *command)
{
    OSErr err;
    AppleEvent theAEvent, theReply;
    AEAddressDesc terminalAddress;
    AEDesc commandDesc;
    OSType terminalCreator = CREATOR;
    
    /* set up locals  */
    AECreateDesc(typeNull, NULL, 0, &theAEvent);
    AECreateDesc(typeNull, NULL, 0, &terminalAddress);
    AECreateDesc(typeNull, NULL, 0, &theReply);
    AECreateDesc(typeNull, NULL, 0, &commandDesc);
    
    /* create the "activate" event for Terminal */
    err = AECreateDesc(typeApplSignature, (Ptr) &terminalCreator,
            sizeof(terminalCreator), &terminalAddress);
    if (err != noErr) {
        NSLog(@"doscript: AECreateDesc: error %d\n", err);
        goto bail;
    }
    err = AECreateAppleEvent(ACTIVATE_SUITE, ACTIVATE_CMD,
            &terminalAddress, kAutoGenerateReturnID,
            kAnyTransactionID, &theAEvent);
    
    if (err != noErr) {
        NSLog(@"doscript: AECreateAppleEvent(activate): error %d\n", err);
        goto bail;
    }
    /* send the event  */
    err = AESend(&theAEvent, &theReply, kAEWaitReply,
            kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
    if ( err == -600 ) {
        int count=10;
        /* If it failed with "no such process" try to start Terminal */
        err = system(START_TERMINAL);
        if ( err ) {
            NSLog(@"doscript: system(): %s\n", strerror(errno));
            goto bail;
        }
        do {
            sleep(1);
            /* send the event again */
            err = AESend(&theAEvent, &theReply, kAEWaitReply,
                    kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
        } while (err == -600 && --count > 0);
        if ( err == -600 )
            NSLog(@"doscript: Could not activate Terminal\n");
    }
    if (err != noErr) {
        NSLog(@"doscript: AESend(activate): error %d\n", err);
        goto bail;
    }
            
    /* create the "doscript with command" event for Terminal */
    err = AECreateAppleEvent(DOSCRIPT_SUITE, DOSCRIPT_CMD,
            &terminalAddress, kAutoGenerateReturnID,
            kAnyTransactionID, &theAEvent);
    if (err != noErr) {
        NSLog(@"doscript: AECreateAppleEvent(doscript): error %d\n", err);
        goto bail;
    }
    
    /* add the command to the apple event */
    err = AECreateDesc(typeChar, command, strlen(command), &commandDesc);
    if (err != noErr) {
        NSLog(@"doscript: AECreateDesc(command): error %d\n", err);
        goto bail;
    }
    err = AEPutParamDesc(&theAEvent, WITHCOMMAND, &commandDesc);
    if (err != noErr) {
        NSLog(@"doscript: AEPutParamDesc: error %d\n", err);
        goto bail;
    }

    /* send the command event to Terminal.app */
    err = AESend(&theAEvent, &theReply, kAEWaitReply,
            kAENormalPriority, kAEDefaultTimeout, NULL, NULL);
    
    if (err != noErr) {
        NSLog(@"doscript: AESend(docommand): error %d\n", err);
        goto bail;
    }
    /* clean up and leave */
bail:
    AEDisposeDesc(&commandDesc);
    AEDisposeDesc(&theAEvent);
    AEDisposeDesc(&terminalAddress);
    AEDisposeDesc(&theReply);
    return err;
}

--- NEW FILE: factorySettings.plist ---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Python GUI Script</key>
        <dict>
                <key>debug</key>
                <false/>
                <key>inspect</key>
                <false/>
                <key>interpreter_list</key>
                <array>
                    <string>/usr/local/bin/pythonw</string>
                    <string>/sw/bin/pythonw</string>
                    <string>/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/python</string>
                    <string>/usr/bin/pythonw</string>
                    <string>/Applications/MacPython-OSX/python-additions/Python.app/Contents/MacOS/python</string>
                </array>
                <key>honourhashbang</key>
                <false/>
                <key>nosite</key>
                <false/>
                <key>optimize</key>
                <false/>
                <key>others</key>
                <string></string>
                <key>verbose</key>
                <false/>
                <key>with_terminal</key>
                <false/>
        </dict>
        <key>Python Script</key>
        <dict>
                <key>debug</key>
                <false/>
                <key>inspect</key>
                <false/>
                <key>interpreter_list</key>
                <array>
                    <string>/usr/local/bin/pythonw</string>
                    <string>/sw/bin/pythonw</string>
                    <string>/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/python</string>
                    <string>/usr/bin/pythonw</string>
                    <string>/Applications/MacPython-OSX/python-additions/Python.app/Contents/MacOS/python</string>
                    <string>/usr/local/bin/python</string>
                    <string>/sw/bin/python</string>
                    <string>/Library/Frameworks/Python.framework/Versions/Current/bin/python</string>
                    <string>/usr/bin/python</string>
                </array>
                <key>honourhashbang</key>
                <false/>
                 <key>nosite</key>
                <false/>
                <key>optimize</key>
                <false/>
                <key>others</key>
                <string></string>
                <key>verbose</key>
                <false/>
                <key>with_terminal</key>
                <true/>
        </dict>
        <key>Python Bytecode Document</key>
        <dict>
                <key>debug</key>
                <false/>
                <key>inspect</key>
                <false/>
                <key>interpreter_list</key>
                <array>
                    <string>/usr/local/bin/pythonw</string>
                    <string>/sw/bin/pythonw</string>
                    <string>/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/python</string>
                    <string>/usr/bin/pythonw</string>
                    <string>/Applications/MacPython-OSX/python-additions/Python.app/Contents/MacOS/python</string>
                    <string>/usr/local/bin/python</string>
                    <string>/sw/bin/python</string>
                    <string>/Library/Frameworks/Python.framework/Versions/Current/bin/python</string>
                    <string>/usr/bin/python</string>
                </array>
                <key>honourhashbang</key>
                <false/>
                 <key>nosite</key>
                <false/>
                <key>optimize</key>
                <false/>
                <key>others</key>
                <string></string>
                <key>verbose</key>
                <false/>
                <key>with_terminal</key>
                <true/>
        </dict>
</dict>
</plist>

--- NEW FILE: main.m ---
//
//  main.m
//  PythonLauncher
//
//  Created by Jack Jansen on Fri Jul 19 2002.
//  Copyright (c) 2002 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>

int main(int argc, const char *argv[])
{
    return NSApplicationMain(argc, argv);
}


_______________________________________________
Stackless-checkins mailing list
Stackless-checkins at stackless.com
http://www.stackless.com/mailman/listinfo/stackless-checkins



More information about the Stackless-checkins mailing list