#NEWLINE# @ utils . arg ( '-s' , '--script-id' , help = 'Script uuid' , required = True ) #NEWLINE# @ utils . arg ( '-f' , '--file' , help = 'Script file' , required = True ) #NEWLINE# def do_pyscripts_script_update( cc , args = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) : #NEWLINE# #INDENT# 'Update a mapping.' #NEWLINE# excluded_fields = [ 'checksum' ] #NEWLINE# with open ( args . file ) as fp : #NEWLINE# #INDENT# content = fp . read ( ) #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# script = cc . pyscripts . scripts . get ( script_id = args . script_id ) #NEWLINE# #UNINDENT# except exc . HTTPNotFound : #NEWLINE# #INDENT# raise exc . CommandError ( ( 'Script not found: %s' % args . script_id ) ) #NEWLINE# #UNINDENT# script_dict = script . to_dict ( ) #NEWLINE# for field in excluded_fields : #NEWLINE# #INDENT# del cc [ field ] #NEWLINE# #UNINDENT# script_dict [ 'data' ] = content #NEWLINE# cc . pyscripts . scripts . update ( ** script_dict )