From 87893f96c31ba40f7470441a89666f917e6592b2 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Sun, 30 Apr 2017 21:28:43 +0000 Subject: [PATCH] support writing new resource file Change-Id: I3da9b4697de3e09b7e689b89b7ed103a382fa8d2 Signed-off-by: Doug Hellmann --- downpour/resources.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/downpour/resources.py b/downpour/resources.py index 9e9d7ce..ef2b746 100644 --- a/downpour/resources.py +++ b/downpour/resources.py @@ -51,3 +51,9 @@ def load(filename, missing_ok=False): s['save_state'] = True return to_return + + +def save(filename, to_export): + "Write the resources file." + with open(filename, 'w', encoding='utf-8') as fd: + fd.write(to_export.toYAML())