this repo has no description
at fixPythonPipStalling 56 lines 1.1 kB view raw
1#include <AppKit/AppKit.h> 2#include <Foundation/NSProcessInfo.h> 3#include <Foundation/NSArray.h> 4#include <Foundation/NSString.h> 5#include <Foundation/NSFileManager.h> 6#include "CrashManager.h" 7 8@implementation CrashManager 9 10 11- (void) close: (id)sender 12{ 13 [NSApp terminate: nil]; 14} 15 16 17- (void) debugInfo: (id)sender 18{ 19 /* insert your code here */ 20} 21 22 23- (void) reopen: (id)sender 24{ 25 /* insert your code here */ 26} 27 28- (id) init 29{ 30 self = [super init]; 31 32 NSArray* args = [[NSProcessInfo processInfo] arguments]; 33 if ([args count] == 2) 34 { 35 NSString* dumpPath = [args objectAtIndex: 1]; 36 NSString* text = [NSString stringWithContentsOfFile:dumpPath encoding:NSUTF8StringEncoding error:NULL]; 37 NSArray* elems = [text componentsSeparatedByString:@"---CUT---"]; 38 39 if ([elems count] >= 4) 40 { 41 executablePath = [elems objectAtIndex:0]; 42 commandLine = [elems objectAtIndex:1]; 43 shortDescription = [elems objectAtIndex:2]; 44 fullLog = [elems objectAtIndex:3]; 45 } 46 47 [elems release]; 48 [text release]; 49 50 [[NSFileManager defaultManager] removeItemAtPath:dumpPath error:NULL]; 51 } 52 53 return self; 54} 55 56@end