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
04cbd02e
Commit
04cbd02e
authored
Jul 29, 2015
by
Giorgos Korfiatis
Browse files
fix calling nw for osx
parent
f4acd5dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
agkyra/gui.py
View file @
04cbd02e
...
...
@@ -16,6 +16,7 @@
from
ws4py.client
import
WebSocketBaseClient
from
agkyra.protocol
import
SessionHelper
,
launch_server
from
agkyra.config
import
AGKYRA_DIR
from
agkyra.syncer
import
utils
import
subprocess
import
os
import
stat
...
...
@@ -25,6 +26,12 @@ import logging
CURPATH
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
LOG
=
logging
.
getLogger
(
__name__
)
OSX_DEFAULT_NW_PATH
=
os
.
path
.
join
(
CURPATH
,
'nwjs'
,
'nwjs.app'
,
'Contents'
,
'MacOS'
,
'nwjs'
)
STANDARD_DEFAULT_NW_PATH
=
os
.
path
.
join
(
CURPATH
,
'nwjs'
,
'nw'
)
DEFAULT_NW_PATH
=
OSX_DEFAULT_NW_PATH
if
utils
.
isosx
()
\
else
STANDARD_DEFAULT_NW_PATH
class
GUI
(
WebSocketBaseClient
):
"""Launch the GUI when the SessionHelper server is ready"""
...
...
@@ -37,8 +44,7 @@ class GUI(WebSocketBaseClient):
self
.
session_file
=
kwargs
.
get
(
'session_file'
,
os
.
path
.
join
(
AGKYRA_DIR
,
'session.info'
))
self
.
start
=
self
.
connect
self
.
nw
=
kwargs
.
get
(
'nw'
,
os
.
path
.
join
(
os
.
path
.
join
(
CURPATH
,
'nwjs'
),
'nw'
))
self
.
nw
=
kwargs
.
get
(
'nw'
,
DEFAULT_NW_PATH
)
self
.
gui_code
=
kwargs
.
get
(
'gui_code'
,
os
.
path
.
join
(
CURPATH
,
'nwgui'
))
assert
not
self
.
_gui_running
(
session
),
(
'Failed to initialize GUI, because another GUI is running'
)
...
...
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