@expose(hide=True)
    def default(self):
        if not self.app.pargs.site_name:
            try:
                while not self.app.pargs.site_name:
                    self.app.pargs.site_name = (input('Enter site name : ')
                                                .strip())
            except __HOLE__ as e:
                Log.error(self, 'Unable to read input, Please try again')

        self.app.pargs.site_name = self.app.pargs.site_name.strip()
        (ee_domain, ee_www_domain) = ValidateDomain(self.app.pargs.site_name)

        if not check_domain_exists(self, ee_domain):
            Log.error(self, "site {0} does not exist".format(ee_domain))

        ee_site_webroot = EEVariables.ee_webroot + ee_domain

        if not self.app.pargs.pagespeed:
            if os.path.isfile('/etc/nginx/sites-available/{0}'
                              .format(ee_domain)):
                try:
                    EEShellExec.invoke_editor(self, '/etc/nginx/sites-availa'
                                              'ble/{0}'.format(ee_domain))
                except CommandExecutionError as e:
                    Log.error(self, "Failed invoke editor")
                if (EEGit.checkfilestatus(self, "/etc/nginx",
                   '/etc/nginx/sites-available/{0}'.format(ee_domain))):
                    EEGit.add(self, ["/etc/nginx"], msg="Edit website: {0}"
                              .format(ee_domain))
                    # Reload NGINX
                    if not EEService.reload_service(self, 'nginx'):
                        Log.error(self, "service nginx reload failed. "
                                  "check issues with `nginx -t` command")
            else:
                Log.error(self, "nginx configuration file does not exists"
                          .format(ee_domain))

        elif self.app.pargs.pagespeed:
            if os.path.isfile('{0}/conf/nginx/pagespeed.conf'
                              .format(ee_site_webroot)):
                try:
                    EEShellExec.invoke_editor(self, '{0}/conf/nginx/'
                                              'pagespeed.conf'
                                              .format(ee_site_webroot))
                except CommandExecutionError as e:
                    Log.error(self, "Failed invoke editor")
                if (EEGit.checkfilestatus(self, "{0}/conf/nginx"
                   .format(ee_site_webroot),
                   '{0}/conf/nginx/pagespeed.conf'.format(ee_site_webroot))):
                    EEGit.add(self, ["{0}/conf/nginx".format(ee_site_webroot)],
                              msg="Edit Pagespped config of site: {0}"
                              .format(ee_domain))
                    # Reload NGINX
                    if not EEService.reload_service(self, 'nginx'):
                        Log.error(self, "service nginx reload failed. "
                                  "check issues with `nginx -t` command")
            else:
                Log.error(self, "Pagespeed configuration file does not exists"
                          .format(ee_domain))
dataset/ETHPy150Open EasyEngine/easyengine/ee/cli/plugins/site.py/EESiteEditController.default