-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jinzhe Zeng <[email protected]>
- Loading branch information
Showing
8 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
"""DP-GUI entrypoint.""" | ||
|
||
|
||
def start_dpgui(*, port: int, bind_all: bool, **kwargs): | ||
"""Host DP-GUI server. | ||
Parameters | ||
---------- | ||
port : int | ||
The port to serve DP-GUI on. | ||
bind_all : bool | ||
Serve on all public interfaces. This will expose your DP-GUI instance | ||
to the network on both IPv4 and IPv6 (where available). | ||
**kwargs | ||
additional arguments | ||
""" | ||
try: | ||
from dpgui import ( | ||
start_dpgui, | ||
) | ||
except ModuleNotFoundError: | ||
raise RuntimeError( | ||
"To use DP-GUI, please install the dpgui package:\npip install dpgui" | ||
) | ||
start_dpgui(port=port, bind_all=bind_all) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# SPDX-License-Identifier: LGPL-3.0-or-later | ||
import unittest | ||
|
||
from dpgui import ( | ||
generate_dpgui_templates, | ||
) | ||
|
||
|
||
class TestDPGUI(unittest.TestCase): | ||
def test_dpgui_entrypoints(self): | ||
self.assertTrue(len(generate_dpgui_templates()) > 0) |