]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
flat_length_max is not used anymore
authorHenryk Plötz <henryk@ploetzli.ch>
Thu, 9 Aug 2018 22:07:07 +0000 (00:07 +0200)
committerRaphael Michel <mail@raphaelmichel.de>
Mon, 3 Dec 2018 18:34:17 +0000 (19:34 +0100)
fints/formals.py

index 4e38232f0a785eb8e5b4912b79250d650f2a2b52..ad78d6ed7fade36bdb3f76bb4336669c585891bd 100644 (file)
@@ -163,7 +163,6 @@ class Field:
 
 class TypedField(Field, SubclassesMixin):
     flat_length = 1
-    flat_length_max = 1
 
     def __new__(cls, *args, **kwargs):
         target_cls = None
@@ -216,19 +215,6 @@ class ContainerField(TypedField):
                 raise TypeError("Cannot compute flat length of field {}.{} with variable count".format(self.__class__.__name__, name))
             result = result + field.count * field.flat_length
         return result
-
-    @property
-    def flat_length_max(self):
-        result = 0
-        for name, field in self.type._fields.items():
-            # Note: We're *not* recursing into flat_length_max, because we don't want variable count fields at deeper levels
-            if field.count is not None:
-                result = result + field.count * field.flat_length
-            elif field.max_count is not None:
-                result = result + field.max_count * field.flat_length
-            else:
-                raise TypeError("Cannot compute max flat length of field {}.{} without count and max_count".format(self.__class__.__name__, name))
-        return result
     
 
 class DataElementGroupField(ContainerField):