Skip to content

Commit

Permalink
refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
yibeichan committed Jun 20, 2024
1 parent 91f14dd commit 8970b07
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 1 addition & 3 deletions macros/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
from .macros import (
library_table,
)
from .macros import library_table
from .main import define_env

__all__ = [
Expand Down
13 changes: 8 additions & 5 deletions macros/macros.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from pathlib import Path
import json

from pathlib import Path
import ruamel.yaml
from jinja2 import Environment, FileSystemLoader, select_autoescape

Expand Down Expand Up @@ -38,7 +37,11 @@ def library_table() -> str:

for file in activity_path.glob("*"):

if file.is_dir() or file is None or "valueConstraints" in file.stem:
if (
file.is_dir()
or file is None
or "valueConstraints" in file.stem
):
continue

with open(file) as f:
Expand All @@ -48,8 +51,8 @@ def library_table() -> str:
{
"name": content["@id"],
"description": (
content["description"]
if "description" in content
content["description"]
if "description" in content
else ""
),
"uri": f"{LIBRARY_URL}/tree/master/activities/{activity_path.stem}/{file.stem}{file.suffix}",
Expand Down

0 comments on commit 8970b07

Please sign in to comment.