tinyssg 0.0.6__tar.gz → 0.0.9__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {tinyssg-0.0.6 → tinyssg-0.0.9}/PKG-INFO +1 -1
- {tinyssg-0.0.6 → tinyssg-0.0.9}/pyproject.toml +1 -1
- tinyssg-0.0.6/tinyssg/__main__.py → tinyssg-0.0.9/tinyssg/tinyssg.py +21 -6
- {tinyssg-0.0.6 → tinyssg-0.0.9}/tinyssg.egg-info/PKG-INFO +1 -1
- {tinyssg-0.0.6 → tinyssg-0.0.9}/tinyssg.egg-info/SOURCES.txt +1 -1
- {tinyssg-0.0.6 → tinyssg-0.0.9}/README.md +0 -0
- {tinyssg-0.0.6 → tinyssg-0.0.9}/setup.cfg +0 -0
- {tinyssg-0.0.6 → tinyssg-0.0.9}/tinyssg.egg-info/dependency_links.txt +0 -0
- {tinyssg-0.0.6 → tinyssg-0.0.9}/tinyssg.egg-info/top_level.txt +0 -0
@@ -63,14 +63,21 @@ class TinySSGUtility:
|
|
63
63
|
return result
|
64
64
|
|
65
65
|
@classmethod
|
66
|
-
def get_fullpath(cls, args: dict, pathkey: str) -> str:
|
66
|
+
def get_fullpath(cls, args: dict, pathkey: str = '') -> str:
|
67
67
|
"""
|
68
68
|
Get the full path from the relative path
|
69
69
|
"""
|
70
70
|
if isinstance(args['curdir'], str) and len(args['curdir']) > 0:
|
71
|
-
|
71
|
+
basedir = args['curdir']
|
72
72
|
else:
|
73
|
-
|
73
|
+
basedir = os.getcwd()
|
74
|
+
|
75
|
+
if isinstance(args[pathkey], str) and len(args[pathkey]) > 0:
|
76
|
+
result = os.path.join(basedir, args[pathkey])
|
77
|
+
else:
|
78
|
+
result = basedir
|
79
|
+
|
80
|
+
return result
|
74
81
|
|
75
82
|
@classmethod
|
76
83
|
def clear_output(cls, output_full_path: str) -> None:
|
@@ -103,6 +110,7 @@ class TinySSGUtility:
|
|
103
110
|
|
104
111
|
print(message)
|
105
112
|
|
113
|
+
@classmethod
|
106
114
|
def error_print(cls, message: str) -> None:
|
107
115
|
"""
|
108
116
|
Output error message
|
@@ -482,7 +490,7 @@ class TinySSGDebug:
|
|
482
490
|
"""
|
483
491
|
Output the server stop message
|
484
492
|
"""
|
485
|
-
TinySSGUtility.error_print(
|
493
|
+
TinySSGUtility.error_print(f"Server return code:{process.poll()}")
|
486
494
|
TinySSGUtility.error_print('Server Output:\n')
|
487
495
|
TinySSGUtility.error_print(process.stdout.read() if process.stdout else '')
|
488
496
|
TinySSGUtility.error_print(process.stderr.read() if process.stderr else '')
|
@@ -566,13 +574,20 @@ class TinySSGLauncher:
|
|
566
574
|
"""
|
567
575
|
url = f"http://localhost:{args['port']}/{args['output']}/"
|
568
576
|
|
577
|
+
is_jupyter = False
|
578
|
+
|
569
579
|
try:
|
570
580
|
from IPython import get_ipython # type: ignore
|
571
581
|
env = get_ipython().__class__.__name__
|
572
582
|
if env == 'ZMQInteractiveShell':
|
573
|
-
|
574
|
-
display.display(display.IFrame(url, width=args['jwidth'], height=args['jheight']))
|
583
|
+
is_jupyter = True
|
575
584
|
except: # noqa: E722
|
585
|
+
pass
|
586
|
+
|
587
|
+
if is_jupyter:
|
588
|
+
from IPython import display
|
589
|
+
display.display(display.IFrame(url, width=args['jwidth'], height=args['jheight']))
|
590
|
+
else:
|
576
591
|
webbrowser.open(url)
|
577
592
|
|
578
593
|
@classmethod
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|