bugged
stringlengths
4
228k
fixed
stringlengths
0
96.3M
__index_level_0__
int64
0
481k
def indentNote_(self, sender): selectionPath = self.outlineTreeController.selectionIndexPath() if not selectionPath: NSBeep() return
def indentNote_(self, sender): selectionPath = self.outlineTreeController.selectionIndexPath() if not selectionPath: NSBeep() return
30,500
def indentNote_(self, sender): selectionPath = self.outlineTreeController.selectionIndexPath() if not selectionPath: NSBeep() return
def indentNote_(self, sender): selectionPath = self.outlineTreeController.selectionIndexPath() if not selectionPath: NSBeep() return
30,501
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,502
def selectClass_(self, event): rowNr = self.classTable.selectedRow() if rowNr == -1: self.clearClassInfo() else: item = self.classTable.itemAtRow_(rowNr) self.setClassInfo(unwrap_object(item))
def outlineViewSelectionDidChange_(self, notification): rowNr = self.classTable.selectedRow() if rowNr == -1: self.clearClassInfo() else: item = self.classTable.itemAtRow_(rowNr) self.setClassInfo(unwrap_object(item))
30,503
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,504
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,505
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,506
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,507
def setUp(self): self.data = NSData.alloc().initWithBytes_length_(rawBytes, len(rawBytes)) self.mutableData = NSMutableData.alloc().initWithBytes_length_(rawBytes, len(rawBytes))
def setUp(self): self.data = NSData.alloc().initWithBytes_length_(rawBytes, len(rawBytes)) self.mutableData = NSMutableData.alloc().initWithBytes_length_(rawBytes, len(rawBytes))
30,508
def testBytes(self): bytes = self.data.bytes() self.assertEquals(len(bytes), len(rawBytes), "bytes() and rawBytes not equal length.") for i in range(0,len(bytes)): self.assertEquals(rawBytes[i], bytes[i], "byte %s of bytes and rawBytes are not equal." % i)
def testBytes(self): """Test -bytes""" data = NSData.alloc().initWithBytes_length_(rawBytes, len(rawBytes)) bytes = data.bytes() self.assertEquals(len(bytes), len(rawBytes), "bytes() and rawBytes not equal length.") for i in range(0,len(bytes)): self.assertEquals(rawBytes[i], bytes[i], "byte %s of bytes and rawBytes ar...
30,509
def testMutableBytes(self): mutableBytes = self.mutableData.mutableBytes() for i in range(0, len(mutableBytes)): mutableBytes[i] = otherBytes[i] mutableBytes[1:8] = otherBytes[1:8]
def testMutableBytes(self): """Test -mutableBytes""" mutableData = NSMutableData.dataWithBytes_length_(rawBytes, len(rawBytes)) mutableBytes = mutableData.mutableBytes() for i in range(0, len(mutableBytes)): mutableBytes[i] = otherBytes[i] mutableBytes[1:8] = otherBytes[1:8]
30,510
def testMutableBytes(self): mutableBytes = self.mutableData.mutableBytes() for i in range(0, len(mutableBytes)): mutableBytes[i] = otherBytes[i] mutableBytes[1:8] = otherBytes[1:8]
def testMutableBytes(self): mutableBytes = self.mutableData.mutableBytes() for i in range(0, len(mutableBytes)): mutableBytes[i] = otherBytes[i] mutableBytes[1:8] = otherBytes[1:8]
30,511
def testMutableBytes(self): mutableBytes = self.mutableData.mutableBytes() for i in range(0, len(mutableBytes)): mutableBytes[i] = otherBytes[i] mutableBytes[1:8] = otherBytes[1:8]
defself.assertDataContents(data, mutableData, bigRawBytes) mutableBytes = mutableData.mutableBytes() bytes = data.bytes() self.assertEquals(len(bytes), data.length()) self.assertEquals(len(mutableBytes), mutableData.length()) self.assertEquals(bytes, mutableBytes) testMutableBytes(self):self.assertDataContents(data...
30,512
def canInitWithRequest_(klass, request): print "canInitWithRequest_" if request.URL().scheme() == PYDOCSCHEME: return True return False
def canInitWithRequest_(klass, request): if request.URL().scheme() == PYDOCSCHEME: return True return False
30,513
def canInitWithRequest_(klass, request): print "canInitWithRequest_" if request.URL().scheme() == PYDOCSCHEME: return True return False
def canInitWithRequest_(klass, request): print "canInitWithRequest_" if request.URL().scheme() == PYDOCSCHEME: return True return False
30,514
def canonicalRequestForRequest_(klass, request): print "canonical", request.URL().standardizedURL().path() return request
def canonicalRequestForRequest_(klass, request): return request
30,515
def canonicalRequestForRequest_(klass, request): print "canonical", request.URL().standardizedURL().path() return request
def canonicalRequestForRequest_(klass, request): print "canonical", request.URL().standardizedURL().path() return request
30,516
def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exc...
def startLoading(self): client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exception, e: pri...
30,517
def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exc...
def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exception, e: print repr(e),...
30,518
def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exc...
def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') try: data = gethtmldoc(modpath.encode('utf-8')) except Exception, e: print repr(e),...
30,519
def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exc...
def startLoading(self): print "start" client = self.client() request = self.request() urlpath = request.URL().standardizedURL().path() print 'urlpath', urlpath modpath = urlpath.replace(u'/', u'.' ).lstrip(u'.' ).replace(u'.html', u'') print 'modpath', modpath try: data = gethtmldoc(modpath.encode('utf-8')) except Exc...
30,520
def stopLoading(self): print "stop"
def stopLoading(self): print "stop"
30,521
def finalize_options (self): self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) if self.pkg_base is None: self.pkg_base = os.path.join(self.bdist_base, 'mpkg')
def finalize_options (self): self.set_undefined_options('bdist', ('bdist_base', 'bdist_base')) if self.pkg_base is None: self.pkg_base = os.path.join(self.bdist_base, 'mpkg')
30,522
def escquotes(val): return val.replace("'", "'\"'\"'")
def escquotes(val): return val.replace("'", "'\"'\"'")
30,523
def getattr(self, attr): return getattr(self.__pyobjc_object__, attr)
def __getattr__(self, attr): return getattr(self.__pyobjc_object__, attr)
30,524
def getattr(self, attr): return getattr(self.__pyobjc_object__, attr)
def __getattr__(self, attr): return getattr(self.__pyobjc_object__, attr)
30,525
def getattr(self, attr): return getattr(self.__pyobjc_object__, attr)
def __getattr__(self, attr): return getattr(self.__pyobjc_object__, attr)
30,526
typedef void* PYOBJC_VOIDPTR;
typedef void* PYOBJC_VOIDPTR;
30,527
def make_test(name): """ Create a method for use in a unittest, the exec is needed to get the proper function name """ result = { 'meth': getattr(ctests, name) } if sys.platform == 'darwin' and name == 'CheckNSInvoke': # There is a bug in Apple's implementation of NSInvocation # surpress the test failure until Apple f...
def make_test(name): """ Create a method for use in a unittest, the exec is needed to get the proper function name """ result = { 'meth': getattr(ctests, name) } if sys.platform == 'darwin' and name == 'CheckNSInvoke': # There is a bug in Apple's implementation of NSInvocation # surpress the test failure until Apple f...
30,528
fp.write('#ifdef HAVE_BOOL\n')
fp.write('#ifdef HAVE_BOOL\n')
30,529
fp.write('#ifdef HAVE_BOOL\n')
fp.write('#ifdef HAVE_BOOL\n')
30,530
def connectionWindowController(self): return WSTConnectionWindowController.alloc().init().autorelease()
def connectionWindowController(self): return WSTConnectionWindowController.alloc().init()
30,531
def classBundle(cls): framework = NSBundle.bundleForClass_(cls).bundlePath() if framework.startswith(SYSFRAMEWORKS_DIR): framework = framework[len(SYSFRAMEWORKS_DIR):] if framework.endswith('.framework'): framework = framework[:-len('.framework')] return framework
def classBundle(cls): framework = NSBundle.bundleForClass_(cls).bundlePath() if framework.startswith(SYSFRAMEWORKS_DIR): framework = framework[len(SYSFRAMEWORKS_DIR):] if framework.endswith('.framework'): framework = framework[:-len('.framework')] return framework
30,532
def showClass(self, cls): # First expand the tree (to make item visible) super = cls.__bases__[0] if super == objc_object: return
def showClass(self, cls): # First expand the tree (to make item visible) super = cls.__bases__[0] if super == objc_object: return
30,533
def selectClass(self, cls): self.showClass(cls)
def selectClass(self, cls): self.showClass(cls)
30,534
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,535
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,536
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,537
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,538
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
def IfFrameWork(name, packages, extensions): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ if os.path.exists(os.path.join('/System/Library/Frameworks/', name)): return packages, extensions if os.path.exists(os.path.join('/Library/Frameworks/', name)): return packages, ex...
30,539
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
30,540
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
30,541
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
30,542
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
30,543
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
30,544
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
30,545
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
def subprocess(taskName, cmd, validRes=None): print "Performing task: %s" % (taskName,) fd = os.popen(cmd, 'r') for ln in fd.xreadlines(): sys.stdout.write(ln) res = fd.close() if res is not validRes: sys.stderr.write("Task '%s' failed [%d]\n"%(taskName, res)) sys.exit(1)
30,546
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,547
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,548
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,549
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,550
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,551
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,552
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,553
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,554
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,555
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,556
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,557
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,558
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,559
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,560
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,561
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,562
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,563
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,564
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,565
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,566
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,567
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """
30,568
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,569
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,570
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,571
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,572
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,573
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,574
def _extractClassesFromNibFromPath(self, path): path = os.path.normpath(path) if self.parsedNibs.has_key(path): return # we've alread pared this nib nibName = os.path.basename(path) nibInfo = NSDictionary.dictionaryWithContentsOfFile_( os.path.join(path, 'classes.nib')) if nibInfo is None: raise NibLoaderError, "Inval...
def _extractClassesFromNibFromPath(self, path): path = os.path.normpath(path) if self.parsedNibs.has_key(path): return # we've alread pared this nib nibName = os.path.basename(path) nibInfo = NSDictionary.dictionaryWithContentsOfFile_( os.path.join(path, 'classes.nib')) if nibInfo is None: raise NibLoaderError, "Inval...
30,575
def _printClass(self, writer, clsInfo): nibs = clsInfo.nibs if len(nibs) > 1: nibs[-2] = nibs[-2] + " and " + nibs[-1] del nibs[-1] nibs = ", ".join(nibs) writer.writeln("# class defined in %s" % nibs) writer.writeln("class %s(AutoBaseClass):" % clsInfo.name) writer.indent() writer.writeln("# the actual base class is %...
def _printClass(self, writer, clsInfo): nibs = clsInfo.nibs if len(nibs) > 1: nibs[-2] = nibs[-2] + " and " + nibs[-1] del nibs[-1] nibs = ", ".join(nibs) writer.writeln("# class defined in %s" % nibs) writer.writeln("class %s(AutoBaseClass):" % clsInfo.name) writer.indent() writer.writeln("# the actual base class is %...
30,576
def testNSDecimalNumber(self): container = OC_TestIdentity.alloc().init()
def testNSDecimalNumber(self): container = OC_TestIdentity.alloc().init()
30,577
def accessor(func): """ Return an Objective-C method object that is conformant with key-value coding and key-value observing. """ if not isinstance(func, type(accessor)): raise ValueError, '%s is not a function'%(func,) argCount = func.func_code.co_argcount funcName = func.func_name if argCount == 3: if funcName.sta...
def accessor(func): """ Return an Objective-C method object that is conformant with key-value coding and key-value observing. """ if not isinstance(func, type(accessor)): raise ValueError, '%s is not a function'%(func,) argCount = func.func_code.co_argcount funcName = func.func_name if argCount == 3: if funcName.sta...
30,578
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,579
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
defscripts = [ 'Scripts/nibclassbuilder', ], package_version():scripts = [ 'Scripts/nibclassbuilder', ], fpscripts = [ 'Scripts/nibclassbuilder', ], =scripts = [ 'Scripts/nibclassbuilder', ], open('Modules/objc/pyobjc.h',scripts = [ 'Scripts/nibclassbuilder', ], 'r')scripts = [ 'Scripts/nibclassbuilder', ], forscripts ...
30,580
def setUp(self): self.NSObjectInstance = objc.runtime.NSObject.alloc()
def setUp(self): self.NSObjectInstance = objc.runtime.NSObject.alloc()
30,581
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
def package_version(): fp = open('Modules/objc/pyobjc.h', 'r') for ln in fp.readlines(): if ln.startswith('#define OBJC_VERSION'): fp.close() return ln.split()[-1][1:-1] raise ValueError, "Version not found"
30,582
def maybeutf(fn): header = file(fn).read(4) if header.startswith(codecs.BOM_UTF8): return 'utf_8' elif header.startswith(codecs.BOM_UTF16_BE): return 'utf_16_be' elif header.startswith(codecs.BOM_UTF16_LE): return 'utf_16_le' # some hacks to guess BOM-less UTF-16 text elif header[0::2] == '\x00\x00' and header[1::2] !=...
def maybeutf(fn): header = file(fn).read(4) if header.startswith(codecs.BOM_UTF8): return 'utf_8' elif header.startswith(codecs.BOM_UTF16_BE): return 'utf_16_be' elif header.startswith(codecs.BOM_UTF16_LE): return 'utf_16_le' # some hacks to guess BOM-less UTF-16 text elif header[0::2] == '\x00\x00' and header[1::2] !=...
30,583
print "typedef int (*superfunc)();"
print "typedef int (*superfunc)();"
30,584
def doTemplateInfo(aFile, options): if not options.doReverse: basename, extension = os.path.splitext(aFile) encoding = ENCODINGS.get(extension, lambda fn:None)(aFile) doFileSubstitution(aFile, encoding, FORWARDTRANSLATOR)
def doTemplateInfo(aFile, options, translator): basename, extension = os.path.splitext(aFile) encoding = ENCODINGS.get(extension, lambda fn:None)(aFile) doFileSubstitution(aFile, encoding, translator)
30,585
def doSubstitutions(dirName, aName, options): if options.doReverse: translator = REVERSETRANSLATOR else: translator = FORWARDTRANSLATOR path = os.path.join(dirName, aName) if os.path.isdir(path): return specialCommand = SPECIALFILES.get(aName) if specialCommand is not None: specialCommand(path, options) return basen...
def doSubstitutions(dirName, aName, options): if options.doReverse: translator = REVERSETRANSLATOR else: translator = FORWARDTRANSLATOR path = os.path.join(dirName, aName) if os.path.isdir(path): return specialCommand = SPECIALFILES.get(aName) if specialCommand is not None: specialCommand(path, options, translator) r...
30,586
def doSubstitutions(dirName, aName, options): if options.doReverse: translator = REVERSETRANSLATOR else: translator = FORWARDTRANSLATOR path = os.path.join(dirName, aName) if os.path.isdir(path): return specialCommand = SPECIALFILES.get(aName) if specialCommand is not None: specialCommand(path, options) return basen...
def doSubstitutions(dirName, aName, options): if options.doReverse: translator = REVERSETRANSLATOR else: translator = FORWARDTRANSLATOR path = os.path.join(dirName, aName) if os.path.isdir(path): return specialCommand = SPECIALFILES.get(aName) if specialCommand is not None: specialCommand(path, options) return basen...
30,587
def doFileSubstitution(aFile, encoding, translator): _tempFile = tempfile.TemporaryFile() # do the translation debug('encoding is: %s', encoding) inFile = codecs.getreader(encoding)(file(aFile, "rb")) outFile = codecs.getwriter(encoding)(_tempFile) try: for line in inFile: tline = translator(line) outFile.write(tline)...
def doFileSubstitution(aFile, encoding, translator): _tempFile = tempfile.TemporaryFile() # do the translation debug('encoding is: %s', encoding) inFile = codecs.getreader(encoding)(file(aFile, "rb")) outFile = codecs.getwriter(encoding)(_tempFile) try: for line in inFile: tline = translator(line) outFile.write(tline)...
30,588
def main(): parser = build_parser() options, args = parser.parse_args() if not args: parser.print_help() return if len(args) != 2: parser.error("Must specify both a source and destination") return if options.verbose: hdlr = logging.StreamHandler() fmt = logging.Formatter('%(message)s') hdlr.setFormatter(fmt) logger ...
def main(): parser = build_parser() options, args = parser.parse_args() if not args: parser.print_help() return if len(args) != 2: parser.error("Must specify both a source and destination") return if options.verbose: hdlr = logging.StreamHandler() fmt = logging.Formatter('%(message)s') hdlr.setFormatter(fmt) logger ...
30,589
def testClassAndInstanceInstanceOverrideWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstanceInstanceOverride.isInstance(PyObjC_TestClassAndInstanceInstanceOverride), objc.NO) self.assertEquals(PyObjC_TestClassAndInstanceInstanceOverride.alloc().init().isInstance(), objc.NO)
def testClassAndInstanceInstanceOverrideWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstanceInstanceOverride.isInstance(PyObjC_TestClassAndInstanceInstanceOverride), objc.NO) self.assertEquals(PyObjC_TestClassAndInstanceInstanceOverride.alloc().init().isInstance(), objc.NO)
30,590
def testClassAndInstanceClassOverrideWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstanceClassOverride.isInstance(PyObjC_TestClassAndInstanceClassOverride), objc.YES) self.assertEquals(PyObjC_TestClassAndInstanceClassOverride.alloc().init().isInstance(), objc.YES)
def testClassAndInstanceClassOverrideWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstanceClassOverride.isInstance(PyObjC_TestClassAndInstanceClassOverride), objc.YES) self.assertEquals(PyObjC_TestClassAndInstanceClassOverride.alloc().init().isInstance(), objc.YES)
30,591
def testClassAndInstanceSubclassWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstanceSubclass.isInstance(PyObjC_TestClassAndInstanceSubclass), objc.NO) self.assertEquals(PyObjC_TestClassAndInstanceSubclass.alloc().init().isInstance(), objc.YES)
def testClassAndInstanceSubclassWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstanceSubclass.pyobjc_classMethods.isInstance(), objc.NO) self.assertEquals(PyObjC_TestClassAndInstanceSubclass.alloc().init().pyobjc_instanceMethods.isInstance(), objc.YES)
30,592
def testClassAndInstanceWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstance.isInstance(PyObjC_TestClassAndInstance), objc.NO) self.assertEquals(PyObjC_TestClassAndInstance.alloc().init().isInstance(), objc.YES)
def testClassAndInstanceWorkaround(self): self.assertEquals(PyObjC_TestClassAndInstance.pyobjc_classMethods.isInstance(), objc.NO) self.assertEquals(PyObjC_TestClassAndInstance.alloc().init().pyobjc_instanceMethods.isInstance(), objc.YES)
30,593
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
def IfFrameWork(name, packages, extensions, headername=None): """ Return the packages and extensions if the framework exists, or two empty lists if not. """ for pth in ('/System/Library/Frameworks', '/Library/Frameworks'): basedir = os.path.join(pth, name) if os.path.exists(basedir): if (headername is None) or os.path....
30,594
... def __del__(self):
... def __del__(self):
30,595
def handleMountNotification_(self, aNotification): path = aNotification.userInfo()['NSDevicePath'] for aFile in os.listdir(path): if readTheseFiles.match(aFile): fullPath = os.path.join(path, aFile) success, app, None = workspace.getInfoForFile_application_type_(fullPath) if not success: NSLog("Failed to find applicati...
def handleMountNotification_(self, aNotification): path = aNotification.userInfo()['NSDevicePath'] for aFile in os.listdir(path): if readTheseFiles.match(aFile): fullPath = os.path.join(path, aFile) success, app, None = workspace.getInfoForFile_application_type_(fullPath) if not success: NSLog("Failed to find applicati...
30,596
def main(): NSApp = NSApplication.sharedApplication() NSApp.setDelegate_( AppDelegate.alloc().init() ) win = NSWindow.alloc() frame = ((200.0, 300.0), (250.0, 100.0)) win.initWithContentRect_styleMask_backing_defer_ (frame, 15, 2, 0) win.setTitle_ ('HelloWorld') win.setLevel_ (3) # floating window hel = NSButton.a...
def main(): NSApp = NSApplication.sharedApplication() delegate = AppDelegate.alloc().init() NSApp.setDelegate_(delegate) win = NSWindow.alloc() frame = ((200.0, 300.0), (250.0, 100.0)) win.initWithContentRect_styleMask_backing_defer_ (frame, 15, 2, 0) win.setTitle_ ('HelloWorld') win.setLevel_ (3) # floating window...
30,597
def makeCFloat(value): """ C floats and doubles have a different representation, this function returns the result of converting a python float (== C double) to a C float and back. """ return struct.unpack('f',struct.pack('f', value))[0]
def makeCFloat(value): """ C floats and doubles have a different representation, this function returns the result of converting a python float (== C double) to a C float and back. """ return struct.unpack('f',struct.pack('f', value))[0]
30,598
def testAll(self):
def testAll(self):
30,599