def update_version_number(file_obj, new_version_number):
 updated = u'{0}.updated_version_number'.format(file_obj.file_path)
 with zipfile.ZipFile(file_obj.file_path, 'r') as source:
  file_list = source.infolist()
  with zipfile.ZipFile(updated, 'w', zipfile.ZIP_DEFLATED) as dest:
   for file_ in file_list:
    content = source.read(file_.filename)
    if (file_.filename == 'install.rdf'):
     content = _update_version_in_install_rdf(content, new_version_number)
    if (file_.filename in ['package.json', 'manifest.json']):
     content = _update_version_in_json_manifest(content, new_version_number)
    dest.writestr(file_, content)
 shutil.move(updated, file_obj.file_path)

def update_version_number ( file_obj , new_version_number ) : updated = u'{0}.updated_version_number' . format ( file_obj . file_path ) with zipfile . ZipFile ( file_obj . file_path , 'r' ) as source : file_list = source . infolist ( ) with zipfile . ZipFile ( updated , 'w' , zipfile . ZIP_DEFLATED ) as dest : for file_ in file_list : content = source . read ( file_ . filename ) if ( file_ . filename == 'install.rdf' ) : content = _update_version_in_install_rdf ( content , new_version_number ) if ( file_ . filename in [ 'package.json' , 'manifest.json' ] ) : content = _update_version_in_json_manifest ( content , new_version_number ) dest . writestr ( file_ , content ) shutil . move ( updated , file_obj . file_path )
update the manifest to have the new version number .