'Creates a new AppVersionUpload.
Args:
rpcserver: The RPC server to use. Should be an instance of HttpRpcServer
or TestRpcServer.
config: An AppInfoExternal object that specifies the configuration for
this application.
module_yaml_path: The (string) path to the yaml file corresponding to
<config>, relative to the bundle directory.
backend: If specified, indicates the update applies to the given backend.
The backend name must match an entry in the backends: stanza.
error_fh: Unexpected HTTPErrors are printed to this file handle.
usage_reporting: Whether or not to report usage.
ignore_endpoints_failures: True to finish deployment even if there are
errors updating the Google Cloud Endpoints configuration (if there is
one). False if these errors should cause a failure/rollback.'

def __init__(self, rpcserver, config, module_yaml_path='app.yaml', backend=None, error_fh=None, usage_reporting=False, ignore_endpoints_failures=True):

    self.rpcserver = rpcserver
    self.config = config
    self.app_id = self.config.application
    self.module = self.config.module
    self.backend = backend
    self.error_fh = (error_fh or sys.stderr)
    self.version = self.config.version
    self.params = {}
    if self.app_id:
        self.params['app_id'] = self.app_id
    if self.module:
        self.params['module'] = self.module
    if self.backend:
        self.params['backend'] = self.backend
    elif self.version:
        self.params['version'] = self.version
    self.files = {}
    self.all_files = set()
    self.in_transaction = False
    self.deployed = False
    self.started = False
    self.batching = True
    self.logging_context = _ClientDeployLoggingContext(rpcserver, self.params, usage_reporting)
    self.file_batcher = UploadBatcher('file', self.logging_context)
    self.blob_batcher = UploadBatcher('blob', self.logging_context)
    self.errorblob_batcher = UploadBatcher('errorblob', self.logging_context)
    if (not self.config.vm_settings):
        self.config.vm_settings = appinfo.VmSettings()
    self.config.vm_settings['module_yaml_path'] = module_yaml_path
    if (not self.config.auto_id_policy):
        self.config.auto_id_policy = appinfo.DATASTORE_ID_POLICY_DEFAULT
    self.ignore_endpoints_failures = ignore_endpoints_failures
