tinyssg 0.0.5__tar.gz → 0.0.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "tinyssg"
7
- version = "0.0.5"
7
+ version = "0.0.8"
8
8
  description = "A simple static site generator"
9
9
  readme = "README.md"
10
10
  authors = [
@@ -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
File without changes
File without changes