Use ruamel.yaml

pull/24/head
Mason10198 3 years ago
parent 46c0e87010
commit aa18f8cd64

@ -95,7 +95,7 @@ Follow the steps below to install:
apt update apt update
apt upgrade apt upgrade
apt install unzip python3 python3-pip ffmpeg 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)** **Arch (HAMVOIP)**
@ -107,6 +107,7 @@ Follow the steps below to install:
wget https://bootstrap.pypa.io/pip/3.5/get-pip.py wget https://bootstrap.pypa.io/pip/3.5/get-pip.py
python get-pip.py python get-pip.py
pip install pyyaml requests python-dateutil pydub pip install pyyaml requests python-dateutil pydub
pip install ruamel.yaml==0.15.100
``` ```
2. **Download SkywarnPlus** 2. **Download SkywarnPlus**

@ -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

@ -1 +0,0 @@
<EFBFBD>ξΩΛΒ½ΌΎΙοH7-)&',7\½¬¥ <C2A5>Ά¨³Σ?-% "(1MΒ®¦΅<C2A6>΅§°ΙE/&!!&/EΙ°§΅<C2A7>΅¦®ΒM1(" %-?Σ³¨Ά<C2A8> ¥¬½[5)" $+;η·<CEB7>£<EFBFBD> £«Ή<C2AB>9+# #*7g»«¤ <C2A4>Ά©µΫ=,% "(3SΏ­¥ <C2A5>Ά¨±ΝB.&!!'0IΕ―¦΅<C2A6>΅¦―ΕI0'!!&.BΝ±¨Ά<C2A8> ¥­ΏS3(" %,=Ϋµ©Ά<C2A9> ¤«»g7*# #+9<>Ή«£ <C2A3>£<EFBFBD>·η;+$ ")5[½¬¥ <C2A5>Ά¨³Σ?-% "(1MΒ®¦΅<C2A6>΅§°ΙE/&!!&/EΙ°§΅<C2A7>΅¦®ΒM1(" %-?Σ³¨Ά<C2A8> ¥¬½[5)" $+;η·<CEB7>£<EFBFBD> £«Ή<C2AB>9+# #*7g»«¤ <C2A4>Ά©µΫ=,% "(3SΏ­¥ <C2A5>Ά¨±ΝB.&!!'0IΕ―¦΅<C2A6>΅¦―ΕI0'!!&.BΝ±¨Ά<C2A8> ¥­ΏS3(" %,=Ϋµ©Ά<C2A9> ¤«»g7*# #+9Ή«£ <C2A3>£<EFBFBD>·η;+$ ")5[½¬¥ <C2A5>Ά¨³Σ?-% "(1MΑ®¦΅<C2A6>΅§°ΙE/&!!&/EΙ°§΅<C2A7>΅¦®ΑM1(" %-?Σ³¨Ά<C2A8> ¥¬½[5)" $+;η·<CEB7>£<EFBFBD> £«Ή<C2AB>9+# #*7g»«¤ <C2A4>Ά©µΫ=,% "(3SΏ­¥ <C2A5>Ά¨±ΝB.&!!'0IΕ―¦΅<C2A6>΅¦―ΕI0'!!&.AΝ±¨Ά<C2A8> ¥­ΏS3(" %,=Ϋµ©Ά<C2A9> ¤«»g7*# #+9<>Ή«£ <C2A3>£<EFBFBD>·η;+$ ")5[½¬¥ <C2A5>Ά¨³Σ?-% "(1MΒ®¦΅<C2A6>΅§°ΙE/&!!&/EΙ°§΅<C2A7>΅¦®ΒM1(" %-?Σ³¨Ά<C2A8> ¥¬½[5)" $+;η·<CEB7>£<EFBFBD> £«Ή<C2AB>9+# #*7g»«¤ <C2A4>Ά©µΫ=,% "(3SΏ­¥ <C2A5>Ά¨±ΝB.&!!'0IΕ―¦΅<C2A6>΅¦―ΕI0'!!&.BΝ±¨Ά<C2A8> ¥­ΏS3(" %,=Ϋ·¬§¦©­·ΘoI><=BKYn

@ -14,10 +14,11 @@
import os import os
import shutil import shutil
import sys import sys
import yaml #import yaml
import subprocess import subprocess
from pathlib import Path from pathlib import Path
from ruamel.yaml import YAML
yaml = YAML()
# Define a function to change the CT # Define a function to change the CT
def changeCT(ct): def changeCT(ct):
@ -177,7 +178,7 @@ else:
# Load the config file # Load the config file
with open(str(CONFIG_FILE), "r") as f: with open(str(CONFIG_FILE), "r") as f:
config = yaml.safe_load(f) config = yaml.load(f)
if key == "changect": if key == "changect":
value = changeCT(value) value = changeCT(value)
@ -198,7 +199,7 @@ else:
# Save the updated config back to the file # Save the updated config back to the file
with open(str(CONFIG_FILE), "w") as f: 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 # 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"] audio_file = VALID_KEYS[key]["true_file"] if value else VALID_KEYS[key]["false_file"]

Loading…
Cancel
Save

Powered by TurnKey Linux.