Compare commits

...
2 Commits
Author SHA1 Message Date
ari 6ee7ce8f70 ignoring non yaml 2022-09-02 15:45:16 -04:00
ari 2dfbc31b5d v0.7.3 2022-09-02 10:36:55 -04:00
7 changed files with 43 additions and 4 deletions

No files matched your search

+4
View File
@@ -1,5 +1,9 @@
# Changelog ![GitHub release (latest by date)](https://img.shields.io/github/v/release/asosnovsky/Shortumation?label=&style=for-the-badge) # Changelog ![GitHub release (latest by date)](https://img.shields.io/github/v/release/asosnovsky/Shortumation?label=&style=for-the-badge)
## [0.7.3] Bugfixes
- Backend now correctly returns unset alias + description
## [0.7.1] Bugfixes + Italian! ## [0.7.1] Bugfixes + Italian!
- Added support for automations that do not have an `id` - Added support for automations that do not have an `id`
+10 -3
View File
@@ -1,21 +1,28 @@
from pathlib import Path from pathlib import Path
from typing import Iterator, NamedTuple, Tuple, Union from typing import Iterator, NamedTuple, Tuple
from yaml.nodes import Node from yaml.nodes import Node
from src.logger import get_logger
from .manager import YamlManager from .manager import YamlManager
dump_yaml = YamlManager.dump_yaml dump_yaml = YamlManager.dump_yaml
load_yaml = YamlManager.load_yaml load_yaml = YamlManager.load_yaml
logger = get_logger(__file__)
def load_dir_yaml(folder_or_file: Path) -> Iterator[Tuple[Path, dict | list]]: def load_dir_yaml(folder_or_file: Path) -> Iterator[Tuple[Path, dict | list]]:
if folder_or_file.is_dir(): if folder_or_file.is_dir():
for file in folder_or_file.iterdir(): for file in folder_or_file.iterdir():
yield from load_dir_yaml(file) yield from load_dir_yaml(file)
else: else:
with folder_or_file.open("r") as fp: if folder_or_file.suffix.lower() == ".yaml":
yield folder_or_file, load_yaml(fp, root_path=folder_or_file.parent) with folder_or_file.open("r") as fp:
yield folder_or_file, load_yaml(fp, root_path=folder_or_file.parent)
else:
logger.info(f"Ignoring the file {folder_or_file}")
@YamlManager.as_constructor("!include") @YamlManager.as_constructor("!include")
@@ -0,0 +1,7 @@
# all the packages!
This is really cool :)
- A list item!
<<more thisngs!>>
@@ -0,0 +1,7 @@
# all the packages!
This is really cool :)
- A list item!
<<more thisngs!>>
@@ -0,0 +1,7 @@
# all the packages!
This is really cool :)
- A list item!
<<more thisngs!>>
@@ -0,0 +1,7 @@
# all the packages!
This is really cool :)
- A list item!
<<more thisngs!>>
+1 -1
View File
@@ -1,5 +1,5 @@
name: Shortumation name: Shortumation
version: v0.7.1 version: v0.7.3
slug: shortumation slug: shortumation
image: "asosnovsky/shortumation-{arch}" image: "asosnovsky/shortumation-{arch}"
url: "https://github.com/asosnovsky/Shortumation" url: "https://github.com/asosnovsky/Shortumation"