tinyssg 0.0.5__py3-none-any.whl → 0.0.8__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
tinyssg/__main__.py CHANGED
@@ -103,7 +103,8 @@ class TinySSGUtility:
103
103
 
104
104
  print(message)
105
105
 
106
- def error_print(cla, message: str) -> None:
106
+ @classmethod
107
+ def error_print(cls, message: str) -> None:
107
108
  """
108
109
  Output error message
109
110
  """
@@ -482,7 +483,7 @@ class TinySSGDebug:
482
483
  """
483
484
  Output the server stop message
484
485
  """
485
- TinySSGUtility.error_print('Server return code:', process.poll())
486
+ TinySSGUtility.error_print(f"Server return code:{process.poll()}")
486
487
  TinySSGUtility.error_print('Server Output:\n')
487
488
  TinySSGUtility.error_print(process.stdout.read() if process.stdout else '')
488
489
  TinySSGUtility.error_print(process.stderr.read() if process.stderr else '')
@@ -566,13 +567,20 @@ class TinySSGLauncher:
566
567
  """
567
568
  url = f"http://localhost:{args['port']}/{args['output']}/"
568
569
 
570
+ is_jupyter = False
571
+
569
572
  try:
570
573
  from IPython import get_ipython # type: ignore
571
574
  env = get_ipython().__class__.__name__
572
575
  if env == 'ZMQInteractiveShell':
573
- from IPython import display
574
- display.display(display.IFrame(url, width=args['jwidth'], height=args['jheight']))
576
+ is_jupyter = True
575
577
  except: # noqa: E722
578
+ pass
579
+
580
+ if is_jupyter:
581
+ from IPython import display
582
+ display.display(display.IFrame(url, width=args['jwidth'], height=args['jheight']))
583
+ else:
576
584
  webbrowser.open(url)
577
585
 
578
586
  @classmethod
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: tinyssg
3
- Version: 0.0.5
3
+ Version: 0.0.8
4
4
  Summary: A simple static site generator
5
5
  Author: Uniras
6
6
  Author-email: tkappeng@gmail.com
@@ -0,0 +1,5 @@
1
+ tinyssg/__main__.py,sha256=sueS07zBArMNom52meUSmHkO8TNdNUxEKaMfxCkMSIY,27260
2
+ tinyssg-0.0.8.dist-info/METADATA,sha256=T4LpZwNNgfrKtRLv3-_JBnOeIyQ1f583doOv6GwoLog,5068
3
+ tinyssg-0.0.8.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ tinyssg-0.0.8.dist-info/top_level.txt,sha256=8u1XtPYCatbklb6u3NbJbFUbwA8nDKZ6cY3FScGwJDQ,8
5
+ tinyssg-0.0.8.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- tinyssg/__main__.py,sha256=ahz5C5AR4RRTw5Cv5y0AUI7GtrpRtR9p6fL9Wesvfmk,27125
2
- tinyssg-0.0.5.dist-info/METADATA,sha256=8FgJojd0aXYnXCkPScTCyelAXWX-TNTfk3dSlWxuEck,5068
3
- tinyssg-0.0.5.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
- tinyssg-0.0.5.dist-info/top_level.txt,sha256=8u1XtPYCatbklb6u3NbJbFUbwA8nDKZ6cY3FScGwJDQ,8
5
- tinyssg-0.0.5.dist-info/RECORD,,