浏览代码

move main.py out of website folder to avoid antipattern of running a script inside a module's directory

Falko Schindler 2 年之前
父节点
当前提交
58f47afee1
共有 3 个文件被更改,包括 3 次插入3 次删除
  1. 2 2
      main.py
  2. 0 0
      website/__init__.py
  3. 1 1
      website/reference.py

+ 2 - 2
website/main.py → main.py

@@ -2,14 +2,14 @@
 from pathlib import Path
 
 import docutils.core
-import reference
 from pygments.formatters import HtmlFormatter
 
 from nicegui import Client, ui
+from website import reference
 
 ACCENT_COLOR = '#428BF5'
 HEADER_HEIGHT = '70px'
-STATIC = Path(__file__).parent / 'static'
+STATIC = Path(__file__).parent / 'website' / 'static'
 
 
 @ui.page('/')

+ 0 - 0
website/__init__.py


+ 1 - 1
website/reference.py

@@ -2,7 +2,7 @@ from typing import Dict
 
 from nicegui import ui
 
-from example import example
+from .example import example
 
 
 def create_intro() -> None: