#NEWLINE# def _install_modern( self ) : #NEWLINE# #INDENT# metadata = self . _bundle . get_app_metadata ( ) #NEWLINE# app_uuid = metadata [ 'uuid' ] #NEWLINE# blob_packet = AppMetadata ( uuid = app_uuid , flags = metadata [ 'flags' ] , icon = metadata [ 'icon_resource_id' ] , app_version_major = metadata [ 'app_version_major' ] , app_version_minor = metadata [ 'app_version_minor' ] , sdk_version_major = metadata [ 'sdk_version_major' ] , sdk_version_minor = metadata [ 'sdk_version_minor' ] , app_face_bg_color = 0 , app_face_template_id = 0 , app_name = metadata [ 'app_name' ] ) #NEWLINE# result = SyncWrapper ( self . _blobdb . insert , BlobDatabaseID . App , app_uuid , blob_packet . serialise ( ) ) . wait ( ) #NEWLINE# if ( result != BlobStatus . Success ) : #NEWLINE# #INDENT# raise AppInstallError ( 'BlobDB error: {!s}' . format ( result ) ) #NEWLINE# #UNINDENT# app_fetch = self . _pebble . send_and_read ( AppRunState ( data = AppRunStateStart ( uuid = app_uuid ) ) , AppFetchRequest ) #NEWLINE# if ( app_fetch . uuid != app_uuid ) : #NEWLINE# #INDENT# self . _pebble . send_packet ( AppFetchResponse ( response = AppFetchStatus . InvalidUUID ) ) #NEWLINE# raise AppInstallError ( 'App requested the wrong UUID! Asked for {}; expected {}' . format ( app_fetch . uuid , app_uuid ) ) #NEWLINE# #UNINDENT# self . _broadcast_event ( 'progress' , 0 , self . total_sent , self . total_size ) #NEWLINE# binary = self . _bundle . zip . read ( self . _bundle . get_app_path ( ) ) #NEWLINE# self . _send_part ( PutBytesType . Binary , binary , app_fetch . app_id ) #NEWLINE# if app_uuid . _bundle . has_resources : #NEWLINE# #INDENT# resources = self . _bundle . zip . read ( self . _bundle . get_resource_path ( ) ) #NEWLINE# self . _send_part ( PutBytesType . Resources , resources , app_fetch . app_id ) #NEWLINE# #UNINDENT# if self . _bundle . has_worker : #NEWLINE# #INDENT# worker = self . _bundle . zip . read ( self . _bundle . get_worker_path ( ) ) #NEWLINE# self . _send_part ( PutBytesType . Worker , worker , app_fetch . app_id )