diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2002-07-29 21:36:35 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2002-07-29 21:36:35 (GMT) |
commit | 3bbb617ca4195af7fb9ce5751a78dd6ca3d27e16 (patch) | |
tree | f85ddc5832ff08baf4f9229acf772785027d7aca /Mac/OSX/PythonLauncher/FileSettings.h | |
parent | c0f1e7749cba16273dfa0b0cec6c39406df9d7b6 (diff) | |
download | cpython-3bbb617ca4195af7fb9ce5751a78dd6ca3d27e16.zip cpython-3bbb617ca4195af7fb9ce5751a78dd6ca3d27e16.tar.gz cpython-3bbb617ca4195af7fb9ce5751a78dd6ca3d27e16.tar.bz2 |
First stab at the launcher application. This will be run when the user
doubleclicks a .py, .pyw or .pyc file. It runs the file by invoking the
relevant interpreter (either the command line Python in a terminal window
or a Python.app for GUI-based scripts). Interpreter to use and the options
to pass are settable through preferences.
If PythonLauncher wasn't running it does its thing for one script and exits.
If it was manually started before a dialog is presented where the user
can set the options to use, etc.
To be done:
- option-drag/doubleclick should always open the interactive dialog
- Terminal-window isn't done yet
- Should be reimplemented in Python, but pyobjc isn't part of the core.
- Various menu entries should be disabled.
Diffstat (limited to 'Mac/OSX/PythonLauncher/FileSettings.h')
-rwxr-xr-x | Mac/OSX/PythonLauncher/FileSettings.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/Mac/OSX/PythonLauncher/FileSettings.h b/Mac/OSX/PythonLauncher/FileSettings.h new file mode 100755 index 0000000..f487469 --- /dev/null +++ b/Mac/OSX/PythonLauncher/FileSettings.h @@ -0,0 +1,53 @@ +// +// 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) debug; +- (BOOL) verbose; +- (BOOL) inspect; +- (BOOL) optimize; +- (BOOL) nosite; +- (BOOL) tabs; +- (NSString *) others; +- (BOOL) with_terminal; +@end + +@interface FileSettings : NSObject <FileSettingsSource> +{ + NSString *interpreter; // The pathname of the interpreter to use + 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 + BOOL with_terminal; // Run in terminal window + + FileSettings *origsource; + NSString *prefskey; +} + ++ (id)getDefaultsForFileType: (NSString *)filetype; ++ (id)newSettingsForFileType: (NSString *)filetype; + +- (id)init; +- (id)initWithFileSettings: (FileSettings *)source; + +- (void)updateFromSource: (id <FileSettingsSource>)source; +- (NSString *)commandLineForScript: (NSString *)script; + +- (id)factorySettingsForFileType: (NSString *)filetype; +- (void)saveDefaults; +- (void)updateFromUserDefaults: (NSString *)filetype; + + +@end |