GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — v1 (#16)
by Maksim
03:39
created

PagedList.total()   A

Complexity

Conditions 1

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 9
ccs 2
cts 2
cp 1
crap 1
rs 9.6666
c 1
b 0
f 0
1
# -*- coding: utf-8 -*-
2
3
4 1
class PagedList(list):
5
	"""
6
	Enumerable structure for array-like responses of the Route4Me API.
7
8
	Several endpoints of Route4Me API return enumerable responses, which
9
	contains meta-information about paging (fields like ``total``, ``limit``,
10
	``offset``). This class allows enumerating requested data along with
11
	mentioned meta-data fields.
12
	"""
13 1
	def __init__(self, total=None, limit=None, offset=None, items=None):
14 1
		_i = tuple() if items is None else items
15 1
		super(PagedList, self).__init__(_i)
16
17 1
		self._r4m_total = total
18 1
		self._r4m_limit = limit
19 1
		self._r4m_offset = offset
20
21 1
	@property
22
	def total(self):
23
		"""
24
		Total results count (taken from API response)
25
26
		:getter: Results count, when available
27
		:rtype: int
28
		"""
29 1
		return self._r4m_total
30
31 1
	@property
32
	def limit(self):
33
		"""
34
		Limit used during endpoint access
35
36
		:getter: Value of ``limit`` parameter if it was used in query
37
		:rtype: int
38
		"""
39 1
		return self._r4m_limit
40
41 1
	@property
42
	def offset(self):
43
		"""
44
		Offset used during endpoint access
45
46
		:getter: Value of ``offset`` parameter if it was used in query
47
		:rtype: int
48
		"""
49
		return self._r4m_offset
50