File: errors.py

package info (click to toggle)
python-braintree 3.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,376 kB
  • ctags: 1,998
  • sloc: python: 13,634; makefile: 73; sh: 8
file content (17 lines) | stat: -rw-r--r-- 458 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from braintree.validation_error_collection import ValidationErrorCollection

class Errors(object):
    def __init__(self, data):
        data["errors"] = []
        self.errors = ValidationErrorCollection(data)
        self.size = self.errors.deep_size

    @property
    def deep_errors(self):
        return self.errors.deep_errors

    def for_object(self, key):
        return self.errors.for_object(key)

    def __len__(self):
        return self.size