Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
agkyra
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
itminedu
agkyra
Commits
5d86291c
Commit
5d86291c
authored
9 years ago
by
Giorgos Korfiatis
Browse files
Options
Downloads
Patches
Plain Diff
Suppress nw stderr if not in debug mode
parent
501952ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
agkyra/gui.py
+7
-3
7 additions, 3 deletions
agkyra/gui.py
with
7 additions
and
3 deletions
agkyra/gui.py
+
7
−
3
View file @
5d86291c
...
...
@@ -47,10 +47,11 @@ DEFAULT_NW_PATH = OSX_DEFAULT_NW_PATH if utils.isosx() \
class
GUI
(
WebSocketBaseClient
):
"""
Launch the GUI when the SessionHelper server is ready
"""
def
__init__
(
self
,
session
,
**
kwargs
):
def
__init__
(
self
,
session
,
debug
=
False
,
**
kwargs
):
"""
Initialize the GUI Launcher
:param session: session dict(ui_id=..., address=...) instance
"""
self
.
debug
=
debug
super
(
GUI
,
self
).
__init__
(
session
[
'
address
'
])
self
.
session_file
=
kwargs
.
get
(
'
session_file
'
,
os
.
path
.
join
(
AGKYRA_DIR
,
'
session.info
'
))
...
...
@@ -93,7 +94,10 @@ class GUI(WebSocketBaseClient):
"""
If handshake OK is, SessionHelper UP goes, so GUI launched can be
"""
LOG
.
info
(
'
Protocol server is UP, start html/js GUI
'
)
try
:
subprocess
.
call
([
self
.
nw
,
self
.
gui_code
,
self
.
session_file
])
with
open
(
os
.
devnull
)
as
fnull
:
fout
=
None
if
self
.
debug
else
fnull
subprocess
.
call
([
self
.
nw
,
self
.
gui_code
,
self
.
session_file
],
stderr
=
fout
,
stdout
=
fout
)
finally
:
self
.
clean_exit
()
LOG
.
debug
(
'
GUI finished, close GUI wrapper connection
'
)
...
...
@@ -106,7 +110,7 @@ def run(callback, debug):
session
=
SessionHelper
().
wait_session_to_load
()
assert
session
,
'
UI server failed to load...
'
LOG
.
info
(
'
Server session is ready, setup the GUI session
'
)
gui
=
GUI
(
session
)
gui
=
GUI
(
session
,
debug
=
debug
)
try
:
LOG
.
info
(
'
Start GUI
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment