<s> """<STR_LIT>""" <EOL> import os <EOL> from shutil import copy <EOL> from host_test_plugins import HostTestPluginBase <EOL> class HostTestPluginCopyMethod_Mbed ( HostTestPluginBase ) : <EOL> """<STR_LIT>""" <EOL> def generic_mbed_copy ( self , image_path , destination_disk ) : <EOL> """<STR_LIT>""" <EOL> result = True <EOL> if not destination_disk . endswith ( '<STR_LIT:/>' ) and not destination_disk . endswith ( '<STR_LIT:\\>' ) : <EOL> destination_disk += '<STR_LIT:/>' <EOL> try : <EOL> copy ( image_path , destination_disk ) <EOL> except Exception , e : <EOL> self . print_plugin_error ( "<STR_LIT>" % ( image_path , destination_disk ) ) <EOL> self . print_plugin_error ( "<STR_LIT>" % str ( e ) ) <EOL> result = False <EOL> return result <EOL> name = '<STR_LIT>' <EOL> type = '<STR_LIT>' <EOL> stable = True <EOL> capabilities = [ '<STR_LIT>' , '<STR_LIT:default>' ] <EOL> required_parameters = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def setup ( self , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> return True <EOL> def execute ( self , capability , * args , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> if not kwargs [ '<STR_LIT>' ] : <EOL> self . print_plugin_error ( "<STR_LIT>" ) <EOL> return False <EOL> if not kwargs [ '<STR_LIT>' ] : <EOL> self . print_plugin_error ( "<STR_LIT>" ) <EOL> return False <EOL> result = False <EOL> if self . check_parameters ( capability , * args , ** kwargs ) : <EOL> if kwargs [ '<STR_LIT>' ] and kwargs [ '<STR_LIT>' ] : <EOL> if capability == '<STR_LIT>' : <EOL> image_path = os . path . normpath ( kwargs [ '<STR_LIT>' ] ) <EOL> destination_disk = os . path . normpath ( kwargs [ '<STR_LIT>' ] ) <EOL> self . check_mount_point_ready ( destination_disk ) <EOL> result = self . generic_mbed_copy ( image_path , destination_disk ) <EOL> return result <EOL> def load_plugin ( ) : <EOL> """<STR_LIT>""" <EOL> return HostTestPluginCopyMethod_Mbed ( ) </s>
