commit 60828d279640158b6f99b9a719fb5d3654809f2f parent 77686fbe5ab7674d19619fe48a5e811bbead9fd8 Author: Carlosokumu <carlosokumu254@gmail.com> Date: Wed, 24 Sep 2025 22:12:34 +0300 add method to extract ical fields Diffstat:
| M | ungana/ical/ical_helper.py | | | 11 | +++++++++++ |
1 file changed, 11 insertions(+), 0 deletions(-)
diff --git a/ungana/ical/ical_helper.py b/ungana/ical/ical_helper.py @@ -121,6 +121,17 @@ class ICalHelper: if existing_key == candidate_key: return True return False + + @staticmethod + def extract_ical_field(ev, field: str, decode: bool = True): + val = ev.get(field) + if val is None: + return None + val = val.to_ical() + if decode: + return val.decode("utf-8") + return val +