'Sets the default version.'

def SetVersion(self):

    if self.module:
        modules = self.module.split(',')
        if (len(modules) > 1):
            StatusUpdate(('Setting    the    default    version    of    modules    %s    of    application    %s    to    %s.' % (',    '.join(modules), self.app_id, self.version)), self.error_fh)
            params = [('app_id', self.app_id), ('version', self.version)]
            params.extend((('module', module) for module in modules))
            url = ('/api/appversion/setdefault?' + urllib.urlencode(sorted(params)))
            self.rpcserver.Send(url)
            return
        else:
            StatusUpdate(('Setting    default    version    of    module    %s    of    application    %s    to    %s.' % (self.module, self.app_id, self.version)), self.error_fh)
    else:
        StatusUpdate(('Setting    default    version    of    application    %s    to    %s.' % (self.app_id, self.version)), self.error_fh)
    self.rpcserver.Send('/api/appversion/setdefault', app_id=self.app_id, module=self.module, version=self.version)
