Ronald Oussoren avatar Ronald Oussoren committed 6a500ef

- Minor documentation updates, the real updates have to wait for a print-out
- Fix the key-value encoding stuff (that is: uninttest pass). I don't like
the solution yet.
- Make sure examples actually work.
- CodeGenerator script should only emit code if the current version is stale,
hack this in using 'dupfile'.

Comments (0)

Files changed (24)

 Important items
 ---------------
 
-Remove ``from {AppKit,Foundation} import *``
-...........................................
-
-There are definite plans to replace the AppKit/Foundation modules by module-like
-objects that lazily lookup class objects. This is needed to speed up application
-loading. Just importing everything negates the usefullness of this change.
-
 Better documentation
 ....................
 
 different thread, that does not yet have a Python thread context. This may 
 happen when embedding a PyObjC solution in an existing Cocoa application.
 
+NOTE3: This is not really an important item.
+
 
 Test suite
 ..........
 interpreter is created, even when more than one Python based plugin/bundle is
 loaded.
 
+NOTE: All these are supported for 'pure python' projects, we just have to 
+find a way to make it easier to maintain PB templates. The currently is too
+much manual labor involved in updating them.
+
 Complete Cocoa wrapping
 .......................
 
 The TableModel and TableModel2 examples should be merged, the contain the same
 python code and only differ in the build method.
 
-* method-weirdness.py
-  Not really a suitable example, but shows a strange feature of Apple's 
-  implementation of Cocoa. Move to a unittest.
-
 * addressbook.py
   Cleanup, maybe transform this into a usefull utility (import/export from/to
   CSV springs to mind).
 Another option would be to make the generator script slightly smarter: have
 it emit #if version guards based on the guards found in the header files.
 
+NOTE: This is mostly solved for MacOSX by running the generator script from
+setup.py, although the mechanism needs to be cleaned up.
+
 Access to method implementations
 ................................
 
 it possible to use classAddMethods to replace existing methods while still 
 calling the previous implementation.
 
+The same mechanism could be used to wrap "simple" global functions. OTOH the
+current mechanism works good enough at the moment.
+
 Performance tuning/testing
 ..........................
 
 
 Make core bridge more robust w.r.t. order of loading frameworks. You currently
 get incorrect wrappers if you manually load the AppKit.framework and then 
-import AppKit.
+import AppKit. I (Ronald) know how to do this, but this can wait until after 
+1.0.
 
 Add freelists
 .............
 
 PyObjCSelector objects and (especially) PyObjCObject objects are created on
-a regular basis, we should check if using freelists would speed this up.
+a regular basis, we should check if using freelists would speed this up. See
+also `Performance tuning/testing`.
 

Doc/announcement.txt

-The 0.9 announcement message, mostly present as input for future announcements.
+The 1.0b1 announcement message, mostly present as input for future announcements.
 
 to 
    python-list@python.org
    macpython-sig@python.org
    cocoa-dev@lists.apple.com
 
-subject: ANN: PyObjC 0.9
+subject: ANN: PyObjC 1.0b1
 
-PyObjC 0.9 is now available for download at http://pyobjc.sourceforge.net/  
+PyObjC 1.0b1 is now available for download at http://pyobjc.sourceforge.net/  
 
 PyObjC is a bridge between Python and Objective-C.  It allows full
 featured Cocoa applications to be written in pure Python.  It is also
 curve.  It combines remarkable power with very clear syntax.
 
 The installer package includes a number of Project Builder templates for 
-easily creating new Cocoa-Python projects.  Version 0.9 also introduces 
-support for sytax coloring of Python files in Project Builder.
+easily creating new Cocoa-Python projects, as well as support for 
+syntax-coloring Python files in Project Builder.
 
 PyObjC also supports full introspection of Objective-C classes and 
 direct invocation of Objective-C APIs from the interactive interpreter.
 MacPython 2.3b1.  Users of MacPython 2.3b1 can install PyObjC though the 
 PackageManager application.
 
-PyObjC 0.9 includes many inprovements over earlier versions and users are 
-strongly advised to upgrade.  The installer package will automatically upgrade
-prior releases.
+PyObjC 1.0b1 includes numerous improvements over earlier versions, including:
+
+* Improved performance and stability
+* Better tutorials and examples
+* Initial support for MacOS X 10.1
+* Support for the WebKit framework
+* Write plugin bundles in Python (requires Python 2.3b1)
 
 PyObjC is released with an open source license.
 
 
 on our website (News section):
 
-PyObjC 0.9 has shippped. A disk image and the sources are `available` [link]. 
+PyObjC 1.0b1 has shippped. A disk image and the sources are `available` [link]. 
 There are many new features and bugfixes, the the NEWS file [link] for details.
 
 The PyObjC installer installs a number of examples and project builder templates
 as well as some documentation into /Developer. Users of MacPython 2.3b1 [link] 
 can install this release using the PackageManager application.
 
+XXXX: FIXME
+
 
 to adcnews@apple.com:
 
-subject: PyObjC 0.9 released
+subject: PyObjC 1.0b1 released
 
-PyObjC 0.9 provides a bridge between the Python and Objective-C
+PyObjC 1.0b1 provides a bridge between the Python and Objective-C
 programming languages, allowing the Python programmer
-transparent access to Objective-C-based classes and APIs.
-http://pyobjc.sourceforge.net/
+transparent access to Objective-C-based classes and APIs. Write
+Cocoa applications in Python, using Interface Builder to design
+the user inteface.
 
-[ This is a variation on the 0.8 text, I've switched the roles
-  of Python and Objective-C as this seems to be more natural to
-  me ]
+URL: http://pyobjc.sourceforge.net/

Doc/coding-style.html

 <li>Add appropriate ReST style fields to the top of the document as comments:<pre>
 # Author: David Goodger
 # Contact: goodger@users.sourceforge.net
-# Revision: $Revision: 1.12 $
-# Date: $Date: 2003/06/29 16:32:26 $
+# Revision: $Revision: 1.13 $
+# Date: $Date: 2003/06/30 19:56:19 $
 # Copyright: This module has been placed in the public domain.
 </pre>
 </li>

Examples/EnvironmentPrefs/main.py

 from Foundation import *
 from PreferencePanes import *
 import objc
-from PyObjCTools import NibClassBuilder
+from PyObjCTools import NibClassBuilder, AppHelper
 import os
 
 # Uncomment this during development, you'll get exception tracebacks when
         self.changed = False
         self.replyToShouldUnselect_(NSUnselectNow)
 
-    sheetDidDismiss_returnCode_contextInfo_ = endSheetMethod(
+    sheetDidDismiss_returnCode_contextInfo_ = AppHelper.endSheetMethod(
         sheetDidDismiss_returnCode_contextInfo_)
 
     def saveEnvironment(self):

Examples/HelloWorld.py

         print "Hello again, World!"
 
 def main():
-    NSApp = NSApplication.sharedApplication()
+    app = NSApplication.sharedApplication()
 
     # we must keep a reference to the delegate object ourselves,
     # NSApp.setDelegate_() doesn't retain it. A local variable is
     win.contentView().addSubview_ (hel)
     hel.setBezelStyle_( 4 )
     hel.setTitle_( 'Hello!' )
-    hel.setTarget_( NSApp.delegate() )
+    hel.setTarget_( app.delegate() )
     hel.setAction_( "sayHello:" )
 
     beep = NSSound.alloc()
     bye = NSButton.alloc().initWithFrame_ (((100.0, 10.0), (80.0, 80.0)))
     win.contentView().addSubview_ (bye)
     bye.setBezelStyle_( 4 )
-    bye.setTarget_ (NSApp)
+    bye.setTarget_ (app)
     bye.setAction_ ('stop:')
     bye.setEnabled_ ( 1 )
     bye.setTitle_( 'Goodbye!' )
     win.display()
     win.orderFrontRegardless()		## but this one does
 
-    NSApp.run()    
+    app.run()    
 
 
 if __name__ == '__main__' : main()

Examples/WebServicesTool/WSTConnectionWindowControllerClass.py

             if work is None or not self.working:
                 break
             func, args, kwargs = work
-            NSAutoreleasePool.pyobjcPushPool()
+            pool = NSAutoreleasePool.alloc().init()
             try:
                 func(*args, **kwargs)
             finally:
                 # delete all local references; if they are the last refs they
                 # may invoke autoreleases, which should then end up in our pool
                 del func, args, kwargs, work
-                NSAutoreleasePool.pyobjcPopPool()
+                del pool
 
 
 from PyObjCTools import NibClassBuilder
     
     def getMethods(self, url):
         self._server = xmlrpclib.ServerProxy(url)
-        NSAutoreleasePool.pyobjcPushPool()  # use an extra pool to get rid of intermediates
+        pool = NSAutoreleasePool.alloc().init()  # use an extra pool to get rid of intermediates
         try:
             self._methods = self._server.listMethods()
             self._methodPrefix = ""
                     (exceptionType, exceptionValue, "\n".join(traceback.format_tb(exceptionTraceback))),
                     0)
                 self.stopWorking()
-                NSAutoreleasePool.pyobjcPopPool()
                 return
-        NSAutoreleasePool.pyobjcPopPool()
+
+        del pool
         if self._windowIsClosing:
             return
 
         for aMethod in self._methods:
             if self._windowIsClosing:
                 return
-            NSAutoreleasePool.pyobjcPushPool()  # use an extra pool to get rid of intermediates
+            pool = NSAutoreleasePool.alloc().init()  # use an extra pool to get rid of intermediates
             index = index + 1
             if not (index % 5):
                 self.reloadData()
             self.setStatusTextFieldMessage_("Retrieving signature for method %s (%d of %d)." % (aMethod , index, len(self._methods)))
-            NSAutoreleasePool.pyobjcPopPool()
+            del pool
             methodSignature = getattr(self._server, self._methodPrefix + "methodSignature")(aMethod)
             signatures = None
             if not len(methodSignature):
 Examples
 ========
 
-The examples directory contains a number of projects that demonstrate
+The `examples directory`_ contains a number of projects that demonstrate
 various features of the PyObjC bridge. The scripts at the top level of
-the examples directory were mostly written to test a particular
+the `examples directory`_ were mostly written to test a particular
 feature of the bridge (or document a bug until a fix could be found).
 
+.. _`examples directory`: Examples/00ReadMe.html
+
 CurrencyConverter and TableModel are both examples of standalone
 Cocoa-Python applications.  To build and execute::
 
 ``ProjectBuilder Extras/Project Templates`` directory.  Use Project Builder 
 to build the applications.
 
+
 Project Templates
 =================
 
 The ``ProjectBuilder Extras`` directory contains additional files that can
-be used with Project Builder. The diretory ``Specifications`` contains files
+be used with Project Builder. The directory ``Specifications`` contains files
 that enable syntax coloring for Python files in Project Builder.
 
 The ``Project Templates`` directory contains project templates for

Lib/Foundation/test/test_keyvaluecoding.py

 from Foundation import *
 from PyObjCTools import KeyValueCodingSupport
 
-class StraightPython(KeyValueCodingSupport.KeyValueCoding):
+class StraightPython(object, KeyValueCodingSupport.KeyValueCoding):
     foo = 21
-    bar = 42
+    _bar = 42
     baz = { "bob" : "tail" }
     _didBar = 0
+
     def bar(self):
         self._didBar = 1
         return self._bar
     def setBar(self, aValue):
         self._bar = aValue
-    def didBar(self): return self._didBar
+    def didBar(self): 
+        return self._didBar
 
 class PyObjCMix(NSObject):
+
     foo = 21
-    bar = 42
+    _bar = 42
     baz = { "bob" : "tail" }
     _didBar = 0
+
     def bar(self):
         self._didBar = 1
         return self._bar
     def setBar(self, aValue):
         self._bar = aValue
-    def didBar(self): return self._didBar
+
+    def didBar(self): 
+        return self._didBar
+
+    def valueForKey_(self, aKey):
+        try:
+            v = KeyValueCodingSupport.getValueForKey_(self, aKey)
+            return v
+        except KeyError:
+            zuper = super(self.__class__, self)
+            if zuper.respondsToSelector_("valueForKey:"):
+                return zuper.valueForKey_(aKey)
+
+        raise KeyError, aKey
 
 class TestKeyValueCoding(unittest.TestCase):
     def testValueForKey(self):

Lib/PyObjCTools/KeyValueCodingSupport.py

-from types import FunctionType
+from types import FunctionType, MethodType
 import objc
 from Foundation import *
 
 ### BUG:  If accessing iVar directly and iVar is a callable type, it'll be invoked
 # I don't think there is anything we can do about this because of the way python works
-class BridgedKeyValueMethods(NSObject):
+
+CALL_TP=(FunctionType, MethodType, objc.selector)
+
+def addKeyValueBridgeToClass(aClass):
     def bridgedValueForKey_(self, aKey):
         try:
             v = getValueForKey_(self, aKey)
             return v
         except KeyError:
-            zuper = super(self.__class__, self)
+            zuper = super(aClass, self)
             if zuper.respondsToSelector_("valueForKey:"):
                 return zuper.valueForKey_(aKey)
 
         raise KeyError, aKey
-    bridgedValueForKey_ = objc.selector(bridgedValueForKey_,  argumentTypes="s", returnType="O")
 
-def addKeyValueBridgeToClass(aClass):
-    objc.classAddMethod(aClass, "valueForKey:", BridgedKeyValueMethods.bridgedValueForKey_)
+    objc.classAddMethods(aClass, [
+            objc.selector(
+                bridgedValueForKey_,
+                selector="valueForKey:",
+                signature="@@:@",
+                isClassMethod=0,
+            )])
 
 def getValueForKey_(anObject, aKey):
     upperizedKey = aKey[0].upper() + aKey[1:]
 
     # Accessor methods
     possibleMethod = getattr(anObject, "get" + upperizedKey, None)
-    if possibleMethod and type(possibleMethod) is FunctionType:
-        return possibleMethod(anObject)
+    if possibleMethod and isinstance(possibleMethod, CALL_TP):
+        return possibleMethod()
     aKeyPossibleMethod = getattr(anObject, aKey, None)
-    if aKeyPossibleMethod and type(aKeyPossibleMethod) is FunctionType:
-        return aKeyPossibleMethod(anObject)
+    if aKeyPossibleMethod and isinstance(aKeyPossibleMethod, CALL_TP):
+        return aKeyPossibleMethod()
     possibleIsMethod = getattr(anObject, "is" + upperizedKey, None)
-    if possibleIsMethod and type(possibleIsMethod) is FunctionType:
-        return possibleIsMethod(anObject)
+    if possibleIsMethod and isinstance(possibleIsMethod, CALL_TP):
+        return possibleIsMethod()
 
     # direct access to ivar
     if anObject.accessInstanceVariablesDirectly():

Lib/objc/test/test_methodedits.py

         self.assertEquals(newInstance.newSubMethod(), "<new-method-sub>")
         self.assertEquals(preEverythingInstance.newSubMethod(), "<new-method-sub>")
 
-class TestAddMethodWithNewName(unittest.TestCase):
-    def setUp(self):
-        self.NSObjectClass = MEClass
-
-    def testAddMethodWithNameName(self):
-        objc.classAddMethod(self.NSObjectClass, "doTheFoo", MethodsSub.newMethod)
-        objc.classAddMethod(self.NSObjectClass, "doTheBoo", MethodsSub.newSubMethod)
-
-        self.assert_(self.NSObjectClass.instancesRespondToSelector_("doTheFoo"))
-        self.assert_(self.NSObjectClass.instancesRespondToSelector_("doTheBoo"))
-
-        newInstance = self.NSObjectClass.new()
-        
-        self.assertEquals(newInstance.doTheFoo(), "<sub-new-method>")
-        self.assertEquals(preEverythingInstance.doTheFoo(), "<sub-new-method>")
-        self.assertEquals(newInstance.doTheBoo(), "<new-method-sub>")
-        self.assertEquals(preEverythingInstance.doTheBoo(), "<new-method-sub>")
 
 class TestFromPythonClassToObjCClass(unittest.TestCase):
     def setUp(self):

Modules/objc/module.m

 	return PyObjCClass_New(objc_class);
 }
 
-PyDoc_STRVAR(classAddMethod_doc,
-	     "classAddMethod(targetClass, methodName, method)\n"
-	     "\n"
-	     "Adds method to targetClass with methodName as the name.  If methodName is None, name of method will be extraded from method in the same fashion as classAddMethods().");
-
-static PyObject*
-classAddMethod(PyObject* self __attribute__((__unused__)), 
-	PyObject* args, PyObject* keywds)
-{
-	static 	char* kwlist[] = { "targetClass", "methodName", "method", NULL };
-	PyObject* classObject = NULL;
-	char* methodName = NULL;
-	int methodNameSize = 0;
-	PyObject* method = NULL;
-	Class targetClass;
-	struct objc_method_list *methodsToAdd;
-
-	if (!PyArg_ParseTupleAndKeywords(args, keywds, 
-			"Oz#O:classAddMethod", kwlist,
-			&classObject, &methodName, &methodNameSize, &method)) {
-		return NULL;
-	}
-
-	targetClass  = PyObjCClass_GetClass(classObject);
-	methodsToAdd = objc_allocMethodList(1);
-	if (methodsToAdd == NULL) {
-	    PyErr_NoMemory();
-	    return NULL;
-	}
-
-	methodsToAdd->method_count = 1;
-
-	struct objc_method *objcMethod;
-	objcMethod = &methodsToAdd->method_list[0];
-
-	/* check
-	 * FIXME: We should support functions here, just like with
-	 * class definitions.
-	 */
-	if (!PyObjCSelector_Check(method)) {
-	    PyErr_SetString(PyExc_TypeError,
-			    "All objects in methodArray must be of type "
-			    "<objc.selector>.");
-	    goto cleanup_and_return_error;
-	}
-
-	/* install in methods to add */
-	if ( (methodName != NULL) && (methodNameSize > 0) ) {
-	    SEL aName = sel_getUid(methodName);
-	    if (aName == NULL)
-		aName = sel_registerName(methodName);
-	    if (aName == NULL) {
-		PyErr_SetString(PyExc_TypeError,
-				"Failed to register SEL.");
-		goto cleanup_and_return_error;
-	    }
-	    objcMethod->method_name = aName;
-	} else
-	    objcMethod->method_name = PyObjCSelector_Selector(method);
-	objcMethod->method_types = strdup(PyObjCSelector_Signature(method));
-	objcMethod->method_imp = ObjC_MakeIMPForPyObjCSelector((PyObjCSelector*)method);
-
-	/* add the methods */
-	class_addMethods(targetClass, methodsToAdd);
-
-	Py_INCREF(Py_None);
-	return Py_None;
-
-cleanup_and_return_error:
-	if (methodsToAdd) free(methodsToAdd);
-	return NULL;
-}
 
 PyDoc_STRVAR(classAddMethods_doc,
 	     "classAddMethods(targetClass, methodsArray)\n"
 	/* add the methods */
 	class_addMethods(targetClass, methodsToAdd);
 
+	/* This one shouldn't be necessary, but we get crashes without 
+	 * the next line. The crashes happen when 'targetClass' is a Python
+	 * class.
+	class_addMethods(targetClass, NULL);
+	 */
+
 	Py_INCREF(Py_None);
 	return Py_None;
 
 	  lookUpClass_doc
 	},
 	{
-	  "classAddMethod",
-	  (PyCFunction)classAddMethod,
-	  METH_VARARGS|METH_KEYWORDS,
-	  classAddMethod_doc
-	},
-	{
 	  "classAddMethods",
 	  (PyCFunction)classAddMethods,
 	  METH_VARARGS|METH_KEYWORDS,

Modules/objc/objc-class.m

 	PyObjC_class_info* info;
 	int		   magic;
 
-	//NSLog(@"chkml_called %s %d\n", ((PyTypeObject*)cls)->tp_name, recursive);
 	info = get_class_info(cls);
 
 	if (info->class == NULL) return;
 			 *
 			 * We're save for now because none of the example code 
 			 * uses this feature.
+			 */
 			if (PyDict_GetItemString(dict, name) != NULL) {
 				continue;
 			} 
-			 */
 
 			descr = PyObjCSelector_NewNative(
 					objc_class,

Modules/objc/objc_support.h

 
 	if (cls == NULL) return -1;
 
-	for (p = cls->methodLists; (*p != (struct objc_method_list*)-1) && (*p != NULL);
+	for (p = cls->methodLists; 
+	     (*p != (struct objc_method_list*)-1) && (*p != NULL);
 	     p++) {
+		if (*p == NULL) continue;
+		if (*p == (struct objc_method_list*)1) continue;
+		if (*p == (struct objc_method_list*)-11) continue;
 		res += (*p)->method_count;
 		cnt++;
 	}

Modules/objc/objc_support.m

   struct objc_method_list *mlist;
 
   mlist = malloc(sizeof(struct objc_method_list)
-		 + (numMethods) * sizeof(struct objc_method));
+		 + (numMethods+1) * sizeof(struct objc_method));
   mlist->method_count = 0;
   mlist->obsolete = NULL;
 
   struct objc_method_list *mlist;
 
   mlist = malloc(sizeof(struct objc_method_list)
-		 + ((numMethods) * sizeof(struct objc_method)));
+		 + ((numMethods+1) * sizeof(struct objc_method)));
 
   if (mlist == NULL)
     return NULL;
 <blockquote>
 <p><a href="http://lists.sourceforge.net/lists/listinfo/pyobjc-dev">http://lists.sourceforge.net/lists/listinfo/pyobjc-dev</a></p>
 </blockquote>
-<p>b.bum                Ronald Oussoren
-<a href="mailto:bbum@codefab.com">bbum@codefab.com</a>     <a href="mailto:oussoren@cistron.nl">oussoren@cistron.nl</a></p>
+<p>b.bum &lt;<a href="mailto:bbum@codefab.com">bbum@codefab.com</a>&gt;    Ronald Oussoren &lt;<a href="mailto:oussoren@cistron.nl">oussoren@cistron.nl</a>&gt;</p>
 </body>
 </html>
 
     http://lists.sourceforge.net/lists/listinfo/pyobjc-dev
 
-b.bum                Ronald Oussoren
-bbum@codefab.com     oussoren@cistron.nl
+b.bum <bbum@codefab.com>, Ronald Oussoren <oussoren@cistron.nl>

Scripts/CodeGenerators/cocoa_generator.py

 import func_builder
 import os
 import sys
+from dupfile import dupfile
 
 if not os.path.isdir('Modules'):
     print "Run me from the root of the PyObjC source tree"
 func_builder.FUNC_MAP['NSBeginInformationalAlertSheet'] = BeginSheetMapper
 func_builder.FUNC_MAP['NSBeginCriticalAlertSheet'] = BeginSheetMapper
 
-fd = file('Modules/Foundation/_Fnd_Functions.inc', 'w')
+fd = dupfile('Modules/Foundation/_Fnd_Functions.inc', 'w')
 structs = ['NSPoint', 'NSSize', 'NSRect', 'NSRange']
 for s in structs:
 	func_builder.SIMPLE_TYPES[s] = (
 for s in structs:
 	del func_builder.SIMPLE_TYPES[s]
 
-fd = file('Modules/AppKit/_App_Functions.inc', 'w')
+fd = dupfile('Modules/AppKit/_App_Functions.inc', 'w')
 structs = ['NSAffineTransformStruct', 'NSRect', 'NSPoint']
 for s in structs:
 	func_builder.SIMPLE_TYPES[s] = (

Scripts/CodeGenerators/dupfile.py

+"""
+Implements class dupfile. This is a variant on file that won't actually change
+the fs representation of a file unless you write a different contents, used
+to avoid rebuilding the bridge on every call to setup.py
+"""
+import os
+
+def cmpfile(fn1, fn2):
+    return open(fn1).read() == open(fn2).read()
+
+class dupfile:
+    def __init__(self, fname, mode):
+        self.fname = fname
+        self.tfile = fname + ".wrk"
+        self.mode = mode
+
+        if mode == 'w':
+            self.fp = open(self.tfile, "w")
+        else:
+            self.fp = open(self.fname, mode)
+
+
+    def read(self, bytes=None):
+        if bytes is None:
+            return self.fp.read()
+        else:
+            return self.fp.read(bytes)
+
+    def write(self, bytes):
+        self.fp.write(bytes)
+
+    def flush(self):
+        self.fp.flush()
+
+    def close(self):
+        self.fp.close()
+        if self.mode == 'w':
+            if cmpfile(self.tfile, self.fname):
+                os.unlink(self.tfile)
+            else:
+                os.rename(self.tfile, self.fname)

Scripts/CodeGenerators/enum_generator.py

 import re
 import os
 import sys
+from dupfile import dupfile
 
 START_RE=re.compile('(typedef[\w]|)enum.*{')
 END_RE=re.compile('}')
 	if not os.path.exists(dirname): return
 
 	if fn:
-		fp = open(fn, 'w')
+		fp = dupfile(fn, 'w')
 	else:
 		fp = sys.stdout
 

Scripts/CodeGenerators/func_collector.py

 
 import re
 import os
+from dupfile import *
 
 IDENT='[A-Za-z_][A-Za-z0-9_]*'
 
 
 def generate(dirname, fn = None, match_prefix='', ignore_list=()):
 	if fn:
-		fp = open(fn, 'w')
+		fp = dupfile(fn, 'w')
 	else:
 		import sys
 		fp = sys.stdout

Scripts/CodeGenerators/strconst_generator.py

 
 import re
 import os
+from dupfile import *
 
 MATCH_RE=re.compile('NSString \*([ ]*const[ ]+)?([A-Za-z_][A-Za-z0-9_]*([ ]*,[ ]*\*[ ]*[A-Za-z_][A-Za-z0-9_]*)*);')
 
 	if not os.path.exists(dirname): return
 
 	if fn:
-		fp = open(fn, 'w')
+		fp = dupfile(fn, 'w')
 	else:
 		import sys
 		fp = sys.stdout

Scripts/CodeGenerators/var_generator.py

 
 import re
 import os
+from dupfile import *
 
 IDENT='[A-Za-z_][A-Za-z0-9_]*'
 
 
 def generate(dirname, fn = None, match_prefix='', ignore_list=()):
 	if fn:
-		fp = open(fn, 'w')
+		fp = dupfile(fn, 'w')
 	else:
 		import sys
 		fp = sys.stdout

Scripts/allTestsTogether.py

     importExternalTestCases("test_*.py", root)
     # please unittest
     del sys.argv[1:]
+    #sys.argv.append('-v')
     # run tests
     unittest.main()
 

Scripts/make_distrib.py

 
 print "Generateing HTML documentation"
 os.path.walk('Doc', rest2HTML, ['Doc/announcement.txt'])
-rest2HTML(None, '.', ['Install.txt', 'ReadMe.txt', 'Examples/00ReadMe.txt'])
+rest2HTML(None, '.', ['Install.txt', 'ReadMe.txt', 'Examples/00ReadMe.txt', 'Installer Package/Resources/ReadMe.txt'])
 
 if DOC_ONLY:
     sys.exit(0)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.