diff options
author | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-09-20 17:08:44 +0200 |
---|---|---|
committer | Jauhien Piatlicki (jauhien) <piatlicki@gmail.com> | 2013-09-20 17:08:44 +0200 |
commit | 91b5e1839487e3e26fb7d084ace158d27ce2f36d (patch) | |
tree | 60511329c62a98ab814d9e6dbc27050088c4170d /g_sorcery/fileutils.py | |
parent | developer instructions: fix typo (diff) | |
download | g-sorcery-91b5e1839487e3e26fb7d084ace158d27ce2f36d.tar.gz g-sorcery-91b5e1839487e3e26fb7d084ace158d27ce2f36d.tar.bz2 g-sorcery-91b5e1839487e3e26fb7d084ace158d27ce2f36d.zip |
g_sorcery: fixes
Diffstat (limited to 'g_sorcery/fileutils.py')
-rw-r--r-- | g_sorcery/fileutils.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/g_sorcery/fileutils.py b/g_sorcery/fileutils.py index f444f4a..443206c 100644 --- a/g_sorcery/fileutils.py +++ b/g_sorcery/fileutils.py @@ -27,7 +27,7 @@ class FileJSON(object): Class for JSON files. Supports custom JSON serialization provided by g_sorcery.serialization. """ - def __init__(self, directory, name, mandatories=[]): + def __init__(self, directory, name, mandatories=None): """ Args: directory: File directory. @@ -38,7 +38,10 @@ class FileJSON(object): self.directory = os.path.abspath(directory) self.name = name self.path = os.path.join(directory, name) - self.mandatories = mandatories + if not mandatories: + self.mandatories = [] + else: + self.mandatories = mandatories def read(self): """ @@ -139,7 +142,7 @@ def get_pkgpath(root = None): root = os.path.realpath(root) return os.path.dirname(os.path.abspath(root)) -class ManifestEntry: +class ManifestEntry(object): """ A manifest entry for a file. """ |