Fix signal for cement
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
"""WordOps base controller."""
|
||||
|
||||
from cement.core.controller import CementBaseController, expose
|
||||
|
||||
from wo.core.variables import WOVariables
|
||||
|
||||
VERSION = WOVariables.wo_version
|
||||
|
||||
BANNER = """
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
# To avoid encoding releated error,we defined our custom output handler
|
||||
# I hope we will remove this when we upgarde to Cement 2.6 (Not released yet)
|
||||
import os
|
||||
from cement.utils import fs
|
||||
|
||||
from cement.ext.ext_mustache import MustacheOutputHandler
|
||||
from cement.utils import fs
|
||||
|
||||
|
||||
class WOOutputHandler(MustacheOutputHandler):
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from cement.core.foundation import CementApp
|
||||
from cement.core.exc import CaughtSignal, FrameworkError
|
||||
from cement.core.foundation import CementApp
|
||||
from cement.ext.ext_argparse import ArgParseArgumentHandler
|
||||
from cement.utils.misc import init_defaults
|
||||
|
||||
|
||||
@@ -588,7 +588,7 @@ class WODebugController(CementBaseController):
|
||||
" disabled".format(self.app.pargs.site_name))
|
||||
|
||||
@expose(hide=True)
|
||||
def signal_handler(self, signal, frame):
|
||||
def signal_handler(self, app, signal, frame):
|
||||
"""Handle Ctrl+c hevent for -i option of debug"""
|
||||
self.start = False
|
||||
if self.app.pargs.nginx:
|
||||
|
||||
@@ -173,7 +173,7 @@ class WOSecureController(CementBaseController):
|
||||
port = (ssh_line).split(' ')
|
||||
current_ssh_port = (port[1]).strip()
|
||||
if os.getenv('SUDO_USER'):
|
||||
sudo_user = os.environ['SUDO_USER']
|
||||
sudo_user = os.getenv('SUDO_USER')
|
||||
else:
|
||||
sudo_user = ''
|
||||
data = dict(sshport=current_ssh_port, allowpass='no',
|
||||
|
||||
Reference in New Issue
Block a user