fix: 若干改进
This commit is contained in:
@@ -20,12 +20,23 @@ class NucleonCreatorScreen(Screen):
|
||||
def __init__(self) -> None:
|
||||
super().__init__(name=None, id=None, classes=None)
|
||||
|
||||
def search_templates():
|
||||
from heurams.context import
|
||||
|
||||
def search_templates(self):
|
||||
with open('r','/template/t.timl'):
|
||||
pass
|
||||
from pathlib import Path
|
||||
from heurams.context import config_var
|
||||
template_dir = Path(config_var.get()['paths']['template_dir'])
|
||||
templates = list()
|
||||
for i in template_dir.iterdir():
|
||||
if i.name.endswith('.toml'):
|
||||
try:
|
||||
import toml
|
||||
with open('r', i) as f:
|
||||
dic = toml.load(f)
|
||||
desc = dic['__metadata__']['attribution']['desc']
|
||||
templates.append(desc + ' (' + i.name + ')')
|
||||
except:
|
||||
templates.append(f'无描述模板 ({i.name})')
|
||||
print(templates)
|
||||
return templates
|
||||
|
||||
def compose(self) -> ComposeResult:
|
||||
yield Header(show_clock=True)
|
||||
|
||||
Reference in New Issue
Block a user