Passed
Push — master ( 16f953...0e3ad4 )
by Matěj
01:13
created

NextCloud.response   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 10
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 4

2 Methods

Rating   Name   Duplication   Size   Complexity  
A NextCloudResponse.__init__() 0 6 3
A WebDAVResponse.__init__() 0 2 1
1
2
class NextCloudResponse(object):
3
4
    def __init__(self, response, json_output=True, data=None):
5
        self.raw = response
6
        if not data:
7
            self.data = response.json() if json_output else response.content.decode("UTF-8")
8
        else:
9
            self.data = data
10
11
12
class WebDAVResponse(NextCloudResponse):
13
    def __init__(self, response, data=None):
14
        super(WebDAVResponse, self).__init__(response=response, data=data, json_output=False)
15