Commits

Ronald Oussoren committed 9858f93

Fix bit rot.

Comments (0)

Files changed (7)

pyobjc/Examples/Todo/CalendarMatrix.py

                 if val:
                     val.setTag_(count)
                 count += 1
-        cell.release() # is this needed?
+        #cell.release() # is this needed?
 
         self._selectedDay = NSCalendarDate.dateWithYear_month_day_hour_minute_second_timeZone_(
                 now.yearOfCommonEra(), 
                 0, 
                 0, 
                 0, 
-                NSTimeZone.localTimeZone()).retain()
+                NSTimeZone.localTimeZone()) #.retain()
         return self
 
 

pyobjc/Examples/Todo/InfoWindowController.py

     	return _sharedInfoWindowController
 
     sharedInfoWindowController = selector(
-    	sharedInfoWindowController, class_method=1)
+    	sharedInfoWindowController, isClassMethod=1)
 
     
     def init(self):
 
 
     def __del__(self): # dealloc
-    	self.notifyView.release()
-    	self.reschedView.release()
-    	self.notesView.release()
+    	#self.notifyView.release()
+    	#self.reschedView.release()
+    	#self.notesView.release()
     	
     	NSNotificationCenter.defaultCenter().removeObserver_(self)
 

pyobjc/Examples/Todo/ToDoCell.py

     	self.setAlignment_(NSRightTextAlignment)
 
     	self._doneImage = NSImage.imageNamed_("DoneMark")
-    	if self._doneImage:
-    		self._doneImage.retain()
+    	#if self._doneImage:
+    	#	self._doneImage.retain()
     	self._deferredImage = NSImage.imageNamed_("DeferredMark")
-    	if self._deferredImage:
-    		self._deferredImage.retain()
+    	#if self._deferredImage:
+    	#	self._deferredImage.retain()
     	return self
 
     def setTriState_(self, newState):
     	#else:
     		#print "setTimeDue None" 
 
-    	if self._timeDue:
-    		self._timeDue.autorelease()
+    	#if self._timeDue:
+    	#	self._timeDue.autorelease()
     	if newTime:
     		self._timeDue = newTime
-    		newTime.retain()
+    		#newTime.retain()
     		self.setTitle_(self._timeDue.descriptionWithCalendarFormat_timeZone_locale_("%I:%M %p", NSTimeZone.localTimeZone(), None))
     	else:
     		self._timeDue = None

pyobjc/Examples/Todo/ToDoDocument.py

 
     def __del__(self): # dealloc in Objective-C code
 
-    	if self._activeDays:
-    		self._activeDays.release()
-    	if self._currentItems:
-    		self._currentItems.release()
+    	#if self._activeDays:
+    	#	self._activeDays.release()
+    	#if self._currentItems:
+    	#	self._currentItems.release()
 
     	NSNotificationCenter.defaultCenter().removeObserver_(self)
 
     		aCell.setTarget_(self)
     		aCell.setAction_('itemStatusClicked:')
     		self.statusList.putCell_atRow_column_(aCell, index, 0)
-    		aCell.release()
+    		#aCell.release()
     	
     	if self._dataFromFile:
     		self.loadDocWithData_(self._dataFromFile)
-    		self._dataFromFile.release()
+    		#self._dataFromFile.release()
     		self._dataFromFile = None
     	else:
     		self.loadDocWithData_(None)
     			None))
 
     def initDataModelWithDictionary_(self, dict):
-    	if self._activeDays:
-    		self._activeDays.autorelease()
+    	#if self._activeDays:
+    	#	self._activeDays.autorelease()
 
     	if dict:
-    		self._activeDays = dict.retain()
+    		self._activeDays = dict # .retain()
     	else:
     		self._activeDays = NSMutableDictionary.alloc().init()
 
     	self.setCurrentItems_(self._activeDays.objectForKey_(date))
 
     def setCurrentItems_(self, newItems):
-    	if self._currentItems:
-    		self._currentItems.autorelease()
+    	#if self._currentItems:
+    	#	self._currentItems.autorelease()
 
     	if newItems:
     		self._currentItems = newItems.mutableCopy()
     	elif newName != "":
     		newItem = ToDoItem.alloc().initWithName_andDate_(newName, self.calendar.selectedDay())
     		self._currentItems.replaceObjectAtIndex_withObject_(row, newItem)
-    		newItem.release()
+    		#newItem.release()
 
     	self._selectedItem = self._currentItems.objectAtIndex_(row)
 
     	if selfcalendar:
     		self.loadDocWithData_(data)
     	else:
-    		self._dataFromFile = data.retain()
+    		self._dataFromFile = data #.retain()
 
     	return 1
 

pyobjc/Examples/Todo/ToDoItem.py

     	self._timer = None
 
     	if not aName:
-    		self.release()
+    		#self.release()
     		return None
 
     	self.setItemName_(aName)
     	coder.encodeObject_(self._notes)
     	
     	tempTime = self._secsUntilDue
-    	coder.encodeValueOfObjCType_at_(objc._objc._C_LNG, tempTime)
+    	coder.encodeValueOfObjCType_at_(objc._C_LNG, tempTime)
 
     	tempTime = self._secsUntilNotify
-    	coder.encodeValueOfObjCType_at_(objc._objc._C_LNG, tempTime)
+    	coder.encodeValueOfObjCType_at_(objc._C_LNG, tempTime)
     
     	tempStatus = self._status
-    	coder.encodeValueOfObjCType_at_(objc._objc._C_INT, tempStatus)
+    	coder.encodeValueOfObjCType_at_(objc._C_INT, tempStatus)
 
     def initWithCoder_(self, coder):
     	
     	self.setItemName_(coder.decodeObject())
     	self.setNotes_(coder.decodeObject())
 
-    	tempTime = coder.decodeObjectOfObjCType_at_(objc._objc._C_LNG)
+    	tempTime = coder.decodeObjectOfObjCType_at_(objc._C_LNG)
     	self.setSecsUntilDue_(tempTime)
 
-    	tempTime = coder.decodeObjectOfObjCType_at_(objc._objc._C_LNG)
+    	tempTime = coder.decodeObjectOfObjCType_at_(objc._C_LNG)
     	self.setSecsUntilNotify_(tempTime)
     
-    	tempStatus = coder.decodeObjectOfObjCType_at_(objc._objc._C_INT)
+    	tempStatus = coder.decodeObjectOfObjCType_at_(objc._C_INT)
     	self.setSecsUntilNotify_(tempStatus)
 
     	return self
 
     def __del__(self): # dealloc
     	#if self._itemName: self._itemName.release()
-    	if self._day: self._day.release()
-    	if self._notes: self._notes.release()
+    	#if self._day: self._day.release()
+    	#if self._notes: self._notes.release()
     	if self._notes: 
     		self._timer.invalidate()
-    		self._timer.release()
+    		#self._timer.release()
 
     def setDay_(self, newDay):
-    	self._day = newDay.retain()
+    	self._day = newDay #.retain()
 
     def day(self):
     	return self._day
     def setTimer_(self, newTimer):
     	if self._timer:
     		self._timer.invalidate()
-    		self._timer.autorelease()
+    		#self._timer.autorelease()
 
     	if newTimer:
-    		self._timer = newTimer.retain()
+    		self._timer = newTimer #.retain()
     	else:
     		self._timer = None
 

pyobjc/Examples/pydict-to-objcdict.py

 import pprint
 
 from Foundation import *
+from PyObjCTools.Conversion import propertyListFromPythonCollection
 
 input = { 'a' : [1, 2, 3, 4], 'b' : 'c', 'd' : 3, 'e' : None, 'f' : [1, {2 : 3, 'a' : 'b'}, [3, 4]], 'g' : {'h' : 'i'}, 'j' : (1, 2, 3, 'k', 'l')}
 

pyobjc/Examples/using-nscoder.py

     def encodeWithCoder_(self, coder):
         #super(MyObject, self).encodeWithCoder_(coder)
         #coder.encodeFloat_(2.3)
-        coder.encodeValueOfObjCType_at_(objc._objc._C_INT, 2)
+        coder.encodeValueOfObjCType_at_(objc._C_INT, 2)
     
 
 print 1