Commits

Ronald Oussoren committed e6fc0e3

- Fix copy-paste bug in NibClassBuilder
- Update tutorial in line with recent updates to the bridge

Comments (0)

Files changed (6)

pyobjc/Doc/index.txt

+==========================
+PyObjC documentation index
+==========================
+
+The documentation for PyObjC is lacking at the moment, and is high on our
+TODO list. 
+
+* `An introduction to PyObjC`_
+
+* `Creating your first PyObjC application (tutorial)`_
+
+* `Userguide for PyObjC`_
+
+* `Python classes and Objective-C code`_
+
+* `Coding style for PyObjC`_
+
+* `Using LibFFI with PyObjC`_
+
+* `PyObjC Architecture`_
+
+* `Structure of the PyObjC package`_
+
+* `How to wrap an Objective-C class library`_
+
+* `Odd features`_
+
+.. _`An introduction to PyObjC`: intro.html
+
+..   _`Userguide for PyObjC`: users.html
+
+..   _`Python classes and Objective-C code`: classes.html
+
+..   _`Coding style for PyObjC`: coding-style.html
+
+..   _`Using LibFFI with PyObjC`: libffi.html
+
+..   _`PyObjC Architecture`: architecture.html
+
+..   _`Structure of the PyObjC package`: structure.html
+
+..   _`How to wrap an Objective-C class library`: wrapping.html
+
+..   _`Odd features`: warts.html
+
+..   _`Creating your first PyObjC application (tutorial)`: tutorial/tutorial.html

pyobjc/Doc/tutorial/step12-src/CurrencyConverter.py

 from Foundation import NSObject, NSObject
-from AppKit import NibClassBuilder
-from AppKit.NibClassBuilder import AutoBaseClass
+from PyObjCTools import NibClassBuilder, AppHelper
 
 NibClassBuilder.extractClasses("MainMenu")
 
 
 # class defined in MainMenu.nib
-class Converter(AutoBaseClass):
+class Converter(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     
     def convertAmount(self, amt, rate):
         return amt*rate
 
 # class defined in MainMenu.nib
-class ConverterController(AutoBaseClass):
+class ConverterController(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     # The following outlets are added to the class:
     # converter
             rate = 1/rate
         self.rateField.setFloatValue_(rate)
 
-if __name__ == '__main__':
-	import sys
-	import PyObjCTools.AppHelper
-	PyObjCTools.AppHelper.runEventloop(sys.argv)
+if __name__ == "__main__":
+        AppHelper.runEventLoop()

pyobjc/Doc/tutorial/step4-CurrencyConverter.py

 from Foundation import NSObject, NSObject
-from AppKit import NibClassBuilder
-from AppKit.NibClassBuilder import AutoBaseClass
+from PyObjCTools import NibClassBuilder, AppHelper
 
 NibClassBuilder.extractClasses("MainMenu")
 
 
 # class defined in MainMenu.nib
-class Converter(AutoBaseClass):
+class Converter(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     pass
 
 
 # class defined in MainMenu.nib
-class ConverterController(AutoBaseClass):
+class ConverterController(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     # The following outlets are added to the class:
     # converter
         pass
 
 
+
+if __name__ == "__main__":
+    AppHelper.runEventLoop()

pyobjc/Doc/tutorial/step5-CurrencyConverter.py

 from Foundation import NSObject, NSObject
-from AppKit import NibClassBuilder
-from AppKit.NibClassBuilder import AutoBaseClass
+from PyObjCTools import NibClassBuilder, AppHelper
 
 NibClassBuilder.extractClasses("MainMenu")
 
 
 # class defined in MainMenu.nib
-class Converter(AutoBaseClass):
+class Converter(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     pass
 
 
 # class defined in MainMenu.nib
-class ConverterController(AutoBaseClass):
+class ConverterController(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     # The following outlets are added to the class:
     # converter
     def convert_(self, sender):
         pass
 
-if __name__ == '__main__':
-	import sys
-	import PyObjCTools.AppHelper
-	PyObjCTools.AppHelper.runEventloop(sys.argv)
-	
+if __name__ == "__main__":
+    AppHelper.runEventLoop()

pyobjc/Doc/tutorial/step8-CurrencyConverter.py

 from Foundation import NSObject, NSObject
-from AppKit import NibClassBuilder
-from AppKit.NibClassBuilder import AutoBaseClass
+from PyObjCTools import NibClassBuilder, AppHelper
 
 NibClassBuilder.extractClasses("MainMenu")
 
 
 # class defined in MainMenu.nib
-class Converter(AutoBaseClass):
+class Converter(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     
     def convertAmount(self, amt, rate):
         return amt*rate
 
 # class defined in MainMenu.nib
-class ConverterController(AutoBaseClass):
+class ConverterController(NibClassBuilder.AutoBaseClass):
     # the actual base class is NSObject
     # The following outlets are added to the class:
     # converter
         self.rateField.window().makeKeyAndOrderFront_(self)
         self.rateField.selectText_(self)
 
-if __name__ == '__main__':
-	import sys
-	import PyObjCTools.AppHelper
-	PyObjCTools.AppHelper.runEventloop(sys.argv)
+if __name__ == "__main__":
+        AppHelper.runEventLoop()

pyobjc/Lib/PyObjCTools/NibClassBuilder.py

 				self._printClass(writer, clsInfo)
 				writer.dedent()
                 
-                self._printTemplateFooter(self, writer)
+                self._printTemplateFooter(writer)
 
 	def _printTemplateHeader(self, writer):
 		frameworks = {}
 		writer.writeln()
 		writer.writeln()
 
-	def _printTemplateHeader(self, writer):
+	def _printTemplateFooter(self, writer):
             writer.writeln()
             writer.writeln('if __name__ == "__main__":')
             writer.indent()