gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[www_shared] 02/03: FC: YAML multifile read for translations; Added glob


From: gnunet
Subject: [www_shared] 02/03: FC: YAML multifile read for translations; Added global variable to configure properties file
Date: Mon, 20 Nov 2023 11:49:04 +0100

This is an automated email from the git hooks/post-receive script.

andreas-habegger pushed a commit to branch master
in repository www_shared.

commit 1d496cd5b009d8d420176b00831c4bbd717a4a09
Author: Andreas HABEGGER <andreas.habegger@bfh.ch>
AuthorDate: Sun Nov 19 22:37:03 2023 +0100

    FC: YAML multifile read for translations; Added global variable to 
configure properties file
---
 list-languages | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/list-languages b/list-languages
index 9df48ac..c1379d2 100755
--- a/list-languages
+++ b/list-languages
@@ -1,8 +1,18 @@
 #!/usr/bin/env python3
 
-from ruamel.yaml import YAML
 from pathlib import Path
+from ruamel.yaml import YAML
+
+PROPERTIES_YML = "properties.yml"
+
+# NOTE : read-in properties.yml and afterwards all *.yml in properties.d
+properties = {}
 yaml = YAML(typ="safe")
-config = yaml.load(Path("www.yml"))
-langs = config["langs_full"]
+yaml.preserve_quotes = True
+properties.update(yaml.load(Path(PROPERTIES_YML)))
+properties_dir =  PROPERTIES_YML.removesuffix('.yml') + '.d'
+for filepath in Path(properties_dir).glob('*.yml'):
+    properties.update(yaml.load(filepath))
+
+langs = properties["langs_full"]
 print(" ".join(langs))

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]