#NEWLINE# def _install_or_upgrade( self , install , path , options = None , progress = None ) : #NEWLINE# #INDENT# def callback( cfdict , arg ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# cfpath = CFTypeFrom ( path ) #NEWLINE# if ( options is not None ) : #NEWLINE# #INDENT# cfoptions = CFTypeFrom ( options ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cfoptions = CFTypeFrom ( { #NEWLINE# #INDENT# 'PackageType' : 'Developer' , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# cb = AFCProgressCallback ( callback ) #NEWLINE# if ( progress is not None ) : #NEWLINE# #INDENT# cb = AFCProgressCallback ( progress ) #NEWLINE# #UNINDENT# if install : #NEWLINE# #INDENT# err = AMDeviceInstallApplication ( self . s , cfpath , cfoptions , cb , None ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# err = AMDeviceUpgradeApplication ( self . s , cfpath , cfoptions , cb , None ) #NEWLINE# #UNINDENT# CFRelease ( path ) #NEWLINE# CFRelease ( cfoptions ) #NEWLINE# if ( err != MDERR_OK ) : #NEWLINE# #INDENT# raise RuntimeError ( 'Unable to install application' , err )