Commit 8cedb89c authored by Serhiy Storchaka's avatar Serhiy Storchaka

Merge heads

parents 6cda0adf 3687e805
...@@ -45,18 +45,13 @@ ...@@ -45,18 +45,13 @@
+ (id)getFactorySettingsForFileType: (NSString *)filetype; + (id)getFactorySettingsForFileType: (NSString *)filetype;
+ (id)newSettingsForFileType: (NSString *)filetype; + (id)newSettingsForFileType: (NSString *)filetype;
//- (id)init;
- (id)initForFileType: (NSString *)filetype; - (id)initForFileType: (NSString *)filetype;
- (id)initForFSDefaultFileType: (NSString *)filetype; - (id)initForFSDefaultFileType: (NSString *)filetype;
- (id)initForDefaultFileType: (NSString *)filetype; - (id)initForDefaultFileType: (NSString *)filetype;
//- (id)initWithFileSettings: (FileSettings *)source;
- (void)updateFromSource: (id <FileSettingsSource>)source; - (void)updateFromSource: (id <FileSettingsSource>)source;
- (NSString *)commandLineForScript: (NSString *)script; - (NSString *)commandLineForScript: (NSString *)script;
//- (void)applyFactorySettingsForFileType: (NSString *)filetype;
//- (void)saveDefaults;
//- (void)applyUserDefaults: (NSString *)filetype;
- (void)applyValuesFromDict: (NSDictionary *)dict; - (void)applyValuesFromDict: (NSDictionary *)dict;
- (void)reset; - (void)reset;
- (NSArray *) interpreters; - (NSArray *) interpreters;
......
...@@ -95,12 +95,6 @@ ...@@ -95,12 +95,6 @@
return self; return self;
} }
//- (id)init
//{
// self = [self initForFileType: @"Python Script"];
// return self;
//}
- (id)initForFSDefaultFileType: (NSString *)filetype - (id)initForFSDefaultFileType: (NSString *)filetype
{ {
int i; int i;
......
...@@ -37,20 +37,17 @@ ...@@ -37,20 +37,17 @@
{ {
NSApplication *app = [NSApplication sharedApplication]; NSApplication *app = [NSApplication sharedApplication];
[super close]; [super close];
if ([[app delegate] shouldTerminate]) if ([(MyAppDelegate*)[app delegate] shouldTerminate])
[app terminate: self]; [app terminate: self];
} }
- (void)load_defaults - (void)load_defaults
{ {
// if (settings) [settings release];
settings = [FileSettings newSettingsForFileType: filetype]; settings = [FileSettings newSettingsForFileType: filetype];
} }
- (void)update_display - (void)update_display
{ {
// [[self window] setTitle: script];
[interpreter setStringValue: [settings interpreter]]; [interpreter setStringValue: [settings interpreter]];
[honourhashbang setState: [settings honourhashbang]]; [honourhashbang setState: [settings honourhashbang]];
[debug setState: [settings debug]]; [debug setState: [settings debug]];
...@@ -76,7 +73,7 @@ ...@@ -76,7 +73,7 @@
const char *cmdline; const char *cmdline;
int sts; int sts;
cmdline = [[settings commandLineForScript: script] cString]; cmdline = [[settings commandLineForScript: script] UTF8String];
if ([settings with_terminal]) { if ([settings with_terminal]) {
sts = doscript(cmdline); sts = doscript(cmdline);
} else { } else {
...@@ -109,12 +106,11 @@ ...@@ -109,12 +106,11 @@
BOOL show_ui; BOOL show_ui;
// ask the app delegate whether we should show the UI or not. // ask the app delegate whether we should show the UI or not.
show_ui = [[[NSApplication sharedApplication] delegate] shouldShowUI]; show_ui = [(MyAppDelegate*)[[NSApplication sharedApplication] delegate] shouldShowUI];
[script release]; [script release];
script = [fileName retain]; script = [fileName retain];
[filetype release]; [filetype release];
filetype = [type retain]; filetype = [type retain];
// if (settings) [settings release];
settings = [FileSettings newSettingsForFileType: filetype]; settings = [FileSettings newSettingsForFileType: filetype];
if (show_ui) { if (show_ui) {
[self update_display]; [self update_display];
......
...@@ -27,8 +27,6 @@ ...@@ -27,8 +27,6 @@
- (void)update_display - (void)update_display
{ {
// [[self window] setTitle: script];
[interpreter reloadData]; [interpreter reloadData];
[interpreter setStringValue: [settings interpreter]]; [interpreter setStringValue: [settings interpreter]];
[honourhashbang setState: [settings honourhashbang]]; [honourhashbang setState: [settings honourhashbang]];
...@@ -41,7 +39,6 @@ ...@@ -41,7 +39,6 @@
[others setStringValue: [settings others]]; [others setStringValue: [settings others]];
[with_terminal setState: [settings with_terminal]]; [with_terminal setState: [settings with_terminal]];
// Not scriptargs, it isn't for preferences // Not scriptargs, it isn't for preferences
[commandline setStringValue: [settings commandLineForScript: @"<your script here>"]]; [commandline setStringValue: [settings commandLineForScript: @"<your script here>"]];
} }
......
...@@ -31,7 +31,7 @@ doscript(const char *command) ...@@ -31,7 +31,7 @@ doscript(const char *command)
"'----':utf8(@)", strlen(command), "'----':utf8(@)", strlen(command),
command); command);
if (err) { if (err) {
NSLog(@"AEBuildAppleEvent failed: %d\n", err); NSLog(@"AEBuildAppleEvent failed: %ld\n", (long)err);
return err; return err;
} }
...@@ -39,7 +39,7 @@ doscript(const char *command) ...@@ -39,7 +39,7 @@ doscript(const char *command)
err = AESendMessage(&evt, &res, kAEWaitReply, kAEDefaultTimeout); err = AESendMessage(&evt, &res, kAEWaitReply, kAEDefaultTimeout);
AEDisposeDesc(&evt); AEDisposeDesc(&evt);
if (err) { if (err) {
NSLog(@"AESendMessage failed: %d\n", err); NSLog(@"AESendMessage failed: %ld\n", (long)err);
return err; return err;
} }
// Check for any application errors // Check for any application errors
...@@ -47,12 +47,12 @@ doscript(const char *command) ...@@ -47,12 +47,12 @@ doscript(const char *command)
AEDisposeDesc(&res); AEDisposeDesc(&res);
if (!err) { if (!err) {
AEGetDescData(&desc, &err, sizeof(err)); AEGetDescData(&desc, &err, sizeof(err));
NSLog(@"Terminal returned an error: %d", err); NSLog(@"Terminal returned an error: %ld", (long)err);
AEDisposeDesc(&desc); AEDisposeDesc(&desc);
} else if (err == errAEDescNotFound) { } else if (err == errAEDescNotFound) {
err = noErr; err = noErr;
} else { } else {
NSLog(@"AEGetPArmDesc returned an error: %d", err); NSLog(@"AEGetPArmDesc returned an error: %ld", (long)err);
} }
return err; return err;
......
...@@ -24,6 +24,8 @@ Core and Builtins ...@@ -24,6 +24,8 @@ Core and Builtins
Library Library
------- -------
- Issue #18427: str.replace could crash the interpreter with huge strings.
- Issue #18347: ElementTree's html serializer now preserves the case of - Issue #18347: ElementTree's html serializer now preserves the case of
closing tags. closing tags.
...@@ -67,6 +69,12 @@ Library ...@@ -67,6 +69,12 @@ Library
- Issue #18113: Fixed a refcount leak in the curses.panel module's - Issue #18113: Fixed a refcount leak in the curses.panel module's
set_userptr() method. Reported by Atsuo Ishimoto. set_userptr() method. Reported by Atsuo Ishimoto.
Tools/Demos
-----------
- Issue #12990: The "Python Launcher" on OSX could not launch python scripts
that have paths that include wide characters.
Build Build
----- -----
......
...@@ -882,9 +882,9 @@ string_print(PyStringObject *op, FILE *fp, int flags) ...@@ -882,9 +882,9 @@ string_print(PyStringObject *op, FILE *fp, int flags)
size -= chunk_size; size -= chunk_size;
} }
#ifdef __VMS #ifdef __VMS
if (size) fwrite(data, (int)size, 1, fp); if (size) fwrite(data, (size_t)size, 1, fp);
#else #else
fwrite(data, 1, (int)size, fp); fwrite(data, 1, (size_t)size, fp);
#endif #endif
Py_END_ALLOW_THREADS Py_END_ALLOW_THREADS
return 0; return 0;
...@@ -2332,7 +2332,7 @@ return_self(PyStringObject *self) ...@@ -2332,7 +2332,7 @@ return_self(PyStringObject *self)
} }
Py_LOCAL_INLINE(Py_ssize_t) Py_LOCAL_INLINE(Py_ssize_t)
countchar(const char *target, int target_len, char c, Py_ssize_t maxcount) countchar(const char *target, Py_ssize_t target_len, char c, Py_ssize_t maxcount)
{ {
Py_ssize_t count=0; Py_ssize_t count=0;
const char *start=target; const char *start=target;
......
...@@ -2434,9 +2434,9 @@ builtin_sum(PyObject *self, PyObject *args) ...@@ -2434,9 +2434,9 @@ builtin_sum(PyObject *self, PyObject *args)
PyDoc_STRVAR(sum_doc, PyDoc_STRVAR(sum_doc,
"sum(sequence[, start]) -> value\n\ "sum(sequence[, start]) -> value\n\
\n\ \n\
Returns the sum of a sequence of numbers (NOT strings) plus the value\n\ Return the sum of a sequence of numbers (NOT strings) plus the value\n\
of parameter 'start' (which defaults to 0). When the sequence is\n\ of parameter 'start' (which defaults to 0). When the sequence is\n\
empty, returns start."); empty, return start.");
static PyObject * static PyObject *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment