Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
agkyra
Commits
fcb933e6
Commit
fcb933e6
authored
Jun 05, 2015
by
Stavros Sachtouris
Committed by
Giorgos Korfiatis
Oct 19, 2015
Browse files
Fix calling launch_server from CLI script
parent
b1c5c138
Changes
3
Hide whitespace changes
Inline
Side-by-side
agkyra/gui.py
View file @
fcb933e6
...
...
@@ -82,8 +82,7 @@ class GUI(WebSocketBaseClient):
def
run
():
"""Prepare SessionHelper and GUI and run them in the proper order"""
LOG
.
info
(
'Start SessionHelper session'
)
subprocess
.
Popen
([
os
.
path
.
join
(
CURPATH
,
'scripts/cli.py'
),
'launch_server'
])
subprocess
.
Popen
([
'agkyra-cli'
,
'launch_server'
])
LOG
.
info
(
'Client blocks until session is ready'
)
session
=
SessionHelper
().
wait_session_to_load
()
...
...
agkyra/protocol.py
View file @
fcb933e6
...
...
@@ -147,7 +147,7 @@ class WebSocketProtocol(WebSocket):
GUI: {"method": "post", "path": "pause"}
HELPER: {"OK": 200, "action": "post pause"} or error
--
start
--
--
START
--
GUI: {"method": "post", "path": "start"}
HELPER: {"OK": 200, "action": "post start"} or error
...
...
agkyra/scripts/cli.py
View file @
fcb933e6
...
...
@@ -40,18 +40,20 @@ LOGGER.setLevel(logging.DEBUG)
def
main
():
from
agkyra.cli
import
AgkyraCLI
from
sys
import
argv
AgkyraCLI
().
onecmd
(
' '
.
join
(
argv
[
1
:]
or
[
'help'
,
]))
if
__name__
==
"__main__"
:
if
sys
.
argv
[
1
]
in
(
'launch_server'
,
):
# This piece of code will stay here until the CLI can launch a server
# by itself
from
agkyra.protocol
import
SessionHelper
LOGGER
.
debug
(
'
Please s
tart the session helper'
)
LOGGER
.
debug
(
'
S
tart the session helper'
)
helper
=
SessionHelper
()
if
not
helper
.
load_active_session
():
helper
.
create_session
()
helper
.
server
.
serve_forever
()
else
:
LOGGER
.
info
(
'Another session is running, aborting'
)
else
:
main
()
AgkyraCLI
().
onecmd
(
' '
.
join
(
argv
[
1
:]
or
[
'help'
,
]))
if
__name__
==
"__main__"
:
main
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment