From aa18f8cd640a537b8c223af0f826ca5e2605290b Mon Sep 17 00:00:00 2001 From: Mason10198 <31994327+Mason10198@users.noreply.github.com> Date: Sun, 18 Jun 2023 21:01:42 -0500 Subject: [PATCH] Use ruamel.yaml --- README.md | 3 ++- SOUNDS/TONES/BEEP.ulaw | 1 - SOUNDS/TONES/BOOP.ulaw | 1 - SkyControl.py | 9 +++++---- 4 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 SOUNDS/TONES/BEEP.ulaw delete mode 100644 SOUNDS/TONES/BOOP.ulaw diff --git a/README.md b/README.md index 91db461..537ba3e 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Follow the steps below to install: apt update apt upgrade apt install unzip python3 python3-pip ffmpeg - pip3 install pyyaml requests python-dateutil pydub + pip3 install pyyaml runamel.yaml requests python-dateutil pydub ``` **Arch (HAMVOIP)** @@ -107,6 +107,7 @@ Follow the steps below to install: wget https://bootstrap.pypa.io/pip/3.5/get-pip.py python get-pip.py pip install pyyaml requests python-dateutil pydub + pip install ruamel.yaml==0.15.100 ``` 2. **Download SkywarnPlus** diff --git a/SOUNDS/TONES/BEEP.ulaw b/SOUNDS/TONES/BEEP.ulaw deleted file mode 100644 index fb24079..0000000 --- a/SOUNDS/TONES/BEEP.ulaw +++ /dev/null @@ -1 +0,0 @@ -ÿåÐË×V=6;gº¬¬»E*#)N®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.ͨŸ¥¿3" ,Û©Ÿ¤»7# +« £·;$)[¬ ¢³?%(M®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.ͨŸ¥¿3" ,Û©Ÿ¤»7# +ÿ« £·;$)[¬ ¢³?%(M®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.ͨŸ¥¿3" ,Û©Ÿ¤»7# +ÿ« £·;$)[¬ ¢³?%(M®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «ÿ+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.ͨŸ¥¿3" ,Û©Ÿ¤»7# +« £·;$)[¬ ¢³?%(M®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «ÿ+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.ͨŸ¥¿3" ,Û©Ÿ¤»7# +ÿ« £·;$)[¬ ¢³?%(M®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «ÿ+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.ͨŸ¥¿3" ,Û©Ÿ¤»7# +ÿ« £·;$)[¬ ¢³?%(M®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «ÿ+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.ͨŸ¥¿3" ,Û©Ÿ¤»7# +þ« £·;$)[¬ ¢³?%(M®¡¡°E&&E°¡¡®M(%?³¢ ¬[)$;·£ «ÿ+ #7»¤Ÿ©Û, "3¿¥Ÿ¨Í.!!0ŦŸ¦Å0!!.Ω£ªÅ;,,:ç»¶½ÕWKPe \ No newline at end of file diff --git a/SOUNDS/TONES/BOOP.ulaw b/SOUNDS/TONES/BOOP.ulaw deleted file mode 100644 index 2e03c0c..0000000 --- a/SOUNDS/TONES/BOOP.ulaw +++ /dev/null @@ -1 +0,0 @@ -ÿîÙ˽¼¾ÉïH7-)&',7\½¬¥ Ÿ¢¨³Ó?-% "(1M®¦¡Ÿ¡§°ÉE/&!!&/Eɰ§¡Ÿ¡¦®ÂM1(" %-?Ó³¨¢Ÿ ¥¬½[5)" $+;ç·ª£Ÿ £«¹ÿ9+# #*7g»«¤ Ÿ¢©µÛ=,% "(3S¿­¥ Ÿ¢¨±ÍB.&!!'0Iů¦¡Ÿ¡¦¯ÅI0'!!&.Bͱ¨¢Ÿ ¥­¿S3(" %,=Ûµ©¢Ÿ ¤«»g7*# #+9ÿ¹«£ Ÿ£ª·ç;+$ ")5[½¬¥ Ÿ¢¨³Ó?-% "(1M®¦¡Ÿ¡§°ÉE/&!!&/Eɰ§¡Ÿ¡¦®ÂM1(" %-?Ó³¨¢Ÿ ¥¬½[5)" $+;ç·ª£Ÿ £«¹ÿ9+# #*7g»«¤ Ÿ¢©µÛ=,% "(3S¿­¥ Ÿ¢¨±ÍB.&!!'0Iů¦¡Ÿ¡¦¯ÅI0'!!&.Bͱ¨¢Ÿ ¥­¿S3(" %,=Ûµ©¢Ÿ ¤«»g7*# #+9¹«£ Ÿ£ª·ç;+$ ")5[½¬¥ Ÿ¢¨³Ó?-% "(1MÁ®¦¡Ÿ¡§°ÉE/&!!&/Eɰ§¡Ÿ¡¦®ÁM1(" %-?Ó³¨¢Ÿ ¥¬½[5)" $+;ç·ª£Ÿ £«¹ÿ9+# #*7g»«¤ Ÿ¢©µÛ=,% "(3S¿­¥ Ÿ¢¨±ÍB.&!!'0Iů¦¡Ÿ¡¦¯ÅI0'!!&.Aͱ¨¢Ÿ ¥­¿S3(" %,=Ûµ©¢Ÿ ¤«»g7*# #+9ÿ¹«£ Ÿ£ª·ç;+$ ")5[½¬¥ Ÿ¢¨³Ó?-% "(1M®¦¡Ÿ¡§°ÉE/&!!&/Eɰ§¡Ÿ¡¦®ÂM1(" %-?Ó³¨¢Ÿ ¥¬½[5)" $+;ç·ª£Ÿ £«¹ÿ9+# #*7g»«¤ Ÿ¢©µÛ=,% "(3S¿­¥ Ÿ¢¨±ÍB.&!!'0Iů¦¡Ÿ¡¦¯ÅI0'!!&.Bͱ¨¢Ÿ ¥­¿S3(" %,=Û·¬§¦©­·ÈoI><=BKYn \ No newline at end of file diff --git a/SkyControl.py b/SkyControl.py index 3141f33..149de5a 100644 --- a/SkyControl.py +++ b/SkyControl.py @@ -14,10 +14,11 @@ import os import shutil import sys -import yaml +#import yaml import subprocess from pathlib import Path - +from ruamel.yaml import YAML +yaml = YAML() # Define a function to change the CT def changeCT(ct): @@ -177,7 +178,7 @@ else: # Load the config file with open(str(CONFIG_FILE), "r") as f: - config = yaml.safe_load(f) + config = yaml.load(f) if key == "changect": value = changeCT(value) @@ -198,7 +199,7 @@ else: # Save the updated config back to the file with open(str(CONFIG_FILE), "w") as f: - yaml.dump(config, f, sort_keys=False) + yaml.dump(config, f) # Get the correct audio file based on the new value audio_file = VALID_KEYS[key]["true_file"] if value else VALID_KEYS[key]["false_file"]