diff --git a/lib/newfol/database.py b/lib/newfol/database.py index c24d59f..06ab5cb 100644 --- a/lib/newfol/database.py +++ b/lib/newfol/database.py @@ -38,7 +38,15 @@ class DatabaseVersion(int): Returns None if compression is not enabled. """ - return (None, "xz")[self.compression_version()] + return self.compression_types()[self.compression_version()] + + @staticmethod + def compression_types(): + """A tuple containing supported compression types. + + None is used to indicate the lack of compression. + """ + return (None, "xz") def serialization_version(self): """The value indicating the format in which the data is serialized.""" @@ -49,7 +57,12 @@ class DatabaseVersion(int): This value is suitable for passing to a FileStorage object. """ - return ("csv", "pickle", "json")[self.serialization_version()] + return self.serialization_types()[self.serialization_version()] + + @staticmethod + def serialization_types(): + """A tuple indicating the formats in which data can be serialized.""" + return ("csv", "pickle", "json") def record_version(self): """The record version.