[frontpython commit] r47 - trunk/SDK/PyFR

1 view
Skip to first unread message

codesite...@google.com

unread,
Oct 27, 2008, 2:49:19 AM10/27/08
to frontpyth...@googlegroups.com
Author: jon.christopher
Date: Sun Oct 26 23:48:26 2008
New Revision: 47

Modified:
trunk/SDK/PyFR/Appliance.py
trunk/SDK/PyFR/DynamicMenuController.py
trunk/SDK/PyFR/FileBrowser.py
trunk/SDK/PyFR/MenuController.py
trunk/SDK/PyFR/OptionDialog.py

Log:
deleting or disabling object release() calls. w/o documentation of how FR
handles things, it's impossible to get right

Modified: trunk/SDK/PyFR/Appliance.py
==============================================================================
--- trunk/SDK/PyFR/Appliance.py (original)
+++ trunk/SDK/PyFR/Appliance.py Sun Oct 26 23:48:26 2008
@@ -12,14 +12,12 @@
@classmethod
def initialize(cls):
name = NSString.alloc().initWithString_(
u"com.apple.frontrow.appliance.frontpython" )
- #name.autorelease()
BRFeatureManager.sharedInstance().enableFeatureNamed_( name )

@classmethod
def className(cls):

clsName = NSString.alloc().initWithString_( cls.__name__ )
- #clsName.autorelease()

backtrace = BRBacktracingException.backtrace()
range = backtrace.rangeOfString_( "_loadApplianceInfoAtPath:" )
@@ -31,8 +29,6 @@

if range.location != Foundation.NSNotFound:
clsName =
NSString.alloc().initWithString_( "RUIMoviesAppliance" )
- #clsName.autorelease()
-
return clsName

def applianceController(self):

Modified: trunk/SDK/PyFR/DynamicMenuController.py
==============================================================================
--- trunk/SDK/PyFR/DynamicMenuController.py (original)
+++ trunk/SDK/PyFR/DynamicMenuController.py Sun Oct 26 23:48:26 2008
@@ -102,11 +102,11 @@

def dealloc():
self.log("Deallocing DynamicMenuController %s" %
self.title.encode("ascii","replace")))
- self.ds.release()
+ #self.ds.release()
return super(BRMediaMenuController,self).dealloc()

def initWithMenu_(self, menu):
- BRMenuController.init(self)
+ BRMediaMenuController.init(self)
self.title= menu.page_title
self.addLabel_(menu.page_title)
self.setListTitle_( menu.page_title )

Modified: trunk/SDK/PyFR/FileBrowser.py
==============================================================================
--- trunk/SDK/PyFR/FileBrowser.py (original)
+++ trunk/SDK/PyFR/FileBrowser.py Sun Oct 26 23:48:26 2008
@@ -37,8 +37,8 @@

if menuItem.folder:
menuController =
FileBrowserController.alloc().initWithDirectory_( selectedFile )
- menuController.autorelease()
self.stack().pushController_(menuController)
+ #menuController.release()
else:
self.fileSelected_( selectedFile )


Modified: trunk/SDK/PyFR/MenuController.py
==============================================================================
--- trunk/SDK/PyFR/MenuController.py (original)
+++ trunk/SDK/PyFR/MenuController.py Sun Oct 26 23:48:26 2008
@@ -68,7 +68,7 @@
for item in self.menu.items:
try:
log("releasing layer %s for menu item %s" %
(item.layer, item))
- item.layer.release()
+ #item.layer.release()
except:
pass
#return super(NSObject,self).dealloc()
@@ -113,8 +113,8 @@
return
if IsMenu(self.menu.items[row]):
con =
MenuController.alloc().initWithMenu_(self.menu.items[row])
- con.autorelease()
self.ctrlr.stack().pushController_(con)
+ #con.release()
else:
self.menu.items[row].Activate(self.ctrlr)

@@ -144,11 +144,11 @@

def dealloc(self):
self.log("Dealloc: MenuController %s (%s)" %
(self.title.encode("ascii","replace"),repr(self)))
- self.ds.release()
+ #self.ds.release()
return super(BRMediaMenuController,self).dealloc()

def initWithMenu_(self, menu):
- BRMenuController.init(self)
+ BRMediaMenuController.init(self)
self.title= menu.page_title
self.addLabel_(menu.page_title)
self.setListTitle_( menu.page_title )

Modified: trunk/SDK/PyFR/OptionDialog.py
==============================================================================
--- trunk/SDK/PyFR/OptionDialog.py (original)
+++ trunk/SDK/PyFR/OptionDialog.py Sun Oct 26 23:48:26 2008
@@ -10,6 +10,12 @@

from BackRow import *

+# log info to syslog
+import Foundation
+def log(s):
+ Foundation.NSLog( "%s: %s" % ("PyeTV", str(s) ) )
+ pass
+
class OptionItem(object):
def __init__(self, text, userdata):
self.text = text
@@ -38,8 +44,13 @@
# this should be overridden in the users class
alert =
BRAlertController.alertOfType_titled_primaryText_secondaryText_( 0, "Option
response:", "Option #%s" % str(index), "Userdata: %s" % item.data)
self.stack().pushController_(alert)
+ #alret.release()
return True

+ def dealloc(self):
+ log("Dealloc of OptionDialog")
+ super(BROptionDialog,self).dealloc()
+

#
# example of using a OptionDialog:
@@ -52,19 +63,18 @@
def testOptionDialogHandler(controller,idx,userdata):
alert =
BRAlertController.alertOfType_titled_primaryText_secondaryText_( 0, "Option
response:", "Option #%s" % str(idx), "Userdata: %s" % str(userdata[idx]))
controller.stack().pushController_(alert)
-
+ #alert.release()
# if we return true, we'll pop the controller and back up past the
option dialog
return False

def testOptionDialogTest(controller,arg):
dlg=OptionDialog.alloc().initWithTitle_Items_Handler_UserData_("Test
options",["Select a1","Select b","Select
c"],testOptionDialogHandler,["a","b","c"])
- #dlg.autorelease()
- return controller.stack().pushController_(dlg)
+ ret=controller.stack().pushController_(dlg)
+ #dlg.release()
+ return ret

def testFromMain():
menuItems = [ OptionItem( "select %d" % i, i+50 ) for i in range(0,3) ]

- ret=OptionDialog.alloc().initWithTitle_Items_Handler_( "Test options",
- menuItems )
- #ret.autorelease()
+ ret=OptionDialog.alloc().initWithTitle_Items_Handler_( "Test options",
menuItems )
return ret

Reply all
Reply to author
Forward
0 new messages