fix stop wait_thread

develop
Спиридонов Денис 12 years ago
parent 796d766516
commit fac88e1501

@ -279,10 +279,9 @@ def https_server(client, args, unknown_args, url, clVarsCore, wait_thread):
wait_thread.stop()
return 0
def main():
def main(wait_thread):
parser = parse()
args, unknown_args = parser.parse_known_args()
wait_thread = StoppableThread()
wait_thread.start()
if not args.method and args.help:
wait_thread.stop()

@ -16,7 +16,7 @@
# limitations under the License.
import sys
from calculate.console.application.cl_client import main
from calculate.console.application.cl_client import main, StoppableThread
from calculate.console.application.function import _print
reload(sys)
sys.setdefaultencoding("utf-8")
@ -28,8 +28,10 @@ setLocalTranslate('calculate_console',sys.modules[__name__])
if __name__=='__main__':
__builtin__.__dict__['_print'] = _print
try:
sys.exit(main())
wait_thread = StoppableThread()
sys.exit(main(wait_thread))
except KeyboardInterrupt:
wait_thread.stop()
red = '\033[31m * \033[0m'
print '\n'+red+_('Interrupted by user')
sys.exit(1)
Loading…
Cancel
Save