'Sets the default version.'

def SetDefaultVersion(self):

    module = ''
    if (len(self.args) == 1):
        stored_modules = self.options.module
        self.options.module = None
        try:
            appyaml = self._ParseAppInfoFromYaml(self.args[0])
        finally:
            self.options.module = stored_modules
        app_id = appyaml.application
        module = (appyaml.module or '')
        version = appyaml.version
    elif (not self.args):
        if (not (self.options.app_id and self.options.version)):
            self.parser.error('Expected    a    <directory>    argument    or    both    --application    and    --version    flags.')
    else:
        self._PrintHelpAndExit()
    if self.options.app_id:
        app_id = self.options.app_id
    if self.options.module:
        module = self.options.module
    if self.options.version:
        version = self.options.version
    version_setter = DefaultVersionSet(self._GetRpcServer(), app_id, module, version, self.error_fh)
    version_setter.SetVersion()
