0013-misc-fix-useless-object-inheritance-pylint-error-620.patch
passerelle/apps/atos_genesys/utils.py | ||
---|---|---|
24 | 24 |
yield |
25 | 25 | |
26 | 26 | |
27 |
class RowLockedCache(object):
|
|
27 |
class RowLockedCache: |
|
28 | 28 |
"""Cache return value of a function, always return the cached value for |
29 | 29 |
performance but if the cache is stale update it asynchronously using |
30 | 30 |
a thread, prevent multiple update using row locks on database models and |
passerelle/apps/base_adresse/models.py | ||
---|---|---|
574 | 574 |
self.update_api_geo_data() |
575 | 575 | |
576 | 576 | |
577 |
class UnaccentNameMixin(object):
|
|
577 |
class UnaccentNameMixin: |
|
578 | 578 |
def save(self, *args, **kwargs): |
579 | 579 |
self.unaccent_name = simplify(self.name) |
580 | 580 |
super().save(*args, **kwargs) |
passerelle/apps/cityweb/cityweb.py | ||
---|---|---|
64 | 64 |
return all(is_clean(child) for child in element.iterchildren()) |
65 | 65 | |
66 | 66 | |
67 |
class BaseType(object):
|
|
67 |
class BaseType: |
|
68 | 68 |
"""Base data binding object""" |
69 | 69 | |
70 | 70 |
tagname = None |
passerelle/apps/cmis/models.py | ||
---|---|---|
184 | 184 |
return wrapper |
185 | 185 | |
186 | 186 | |
187 |
class CMISGateway(object):
|
|
187 |
class CMISGateway: |
|
188 | 188 |
def __init__(self, cmis_endpoint, username, password, logger): |
189 | 189 |
self._cmis_client = CmisClient(cmis_endpoint, username, password, passerelle_logger=logger) |
190 | 190 |
self._logger = logger |
passerelle/apps/family/loaders/concerto_fondettes.py | ||
---|---|---|
30 | 30 |
return force_text(s, 'iso-8859-15') |
31 | 31 | |
32 | 32 | |
33 |
class Loader(object):
|
|
33 |
class Loader: |
|
34 | 34 |
def __init__(self, connector): |
35 | 35 |
self.connector = connector |
36 | 36 |
passerelle/apps/family/loaders/concerto_orleans.py | ||
---|---|---|
107 | 107 |
skipinitialspace = False |
108 | 108 | |
109 | 109 | |
110 |
class Loader(object):
|
|
110 |
class Loader: |
|
111 | 111 |
def __init__(self, connector): |
112 | 112 |
self.connector = connector |
113 | 113 |
passerelle/apps/family/loaders/opus_fondettes.py | ||
---|---|---|
30 | 30 |
return force_text(s, 'iso-8859-15') |
31 | 31 | |
32 | 32 | |
33 |
class Loader(object):
|
|
33 |
class Loader: |
|
34 | 34 |
def __init__(self, connector): |
35 | 35 |
self.connector = connector |
36 | 36 |
passerelle/apps/mdel/mdel.py | ||
---|---|---|
32 | 32 |
return default_storage.path('mdel') |
33 | 33 | |
34 | 34 | |
35 |
class AttachedFile(object):
|
|
35 |
class AttachedFile: |
|
36 | 36 |
def __init__(self, code, filename, b64_content): |
37 | 37 |
if code not in ('JI', 'JD'): |
38 | 38 |
raise APIError('%s is not a valid code (JI or JD)' % code) |
... | ... | |
46 | 46 |
default_storage.save(path, ContentFile(self.content)) |
47 | 47 | |
48 | 48 | |
49 |
class MDELBase(object):
|
|
49 |
class MDELBase: |
|
50 | 50 |
def to_string(self): |
51 | 51 |
raw_string = etree.tostring(self.xml, encoding='utf-8') |
52 | 52 |
parsed_string = minidom.parseString(raw_string) |
passerelle/apps/sp_fr/models.py | ||
---|---|---|
187 | 187 |
if not count: |
188 | 188 |
break |
189 | 189 | |
190 |
class FileHandler(object):
|
|
190 |
class FileHandler: |
|
191 | 191 |
def __init__(self, resource, sftp, filename, identifier, procedure, sequence, mapping): |
192 | 192 |
self.resource = resource |
193 | 193 |
self.sftp = sftp |
passerelle/apps/sp_fr/views.py | ||
---|---|---|
23 | 23 |
from . import forms, models |
24 | 24 | |
25 | 25 | |
26 |
class StayIfChanged(object):
|
|
26 |
class StayIfChanged: |
|
27 | 27 |
has_changed = False |
28 | 28 | |
29 | 29 |
def form_valid(self, form): |
passerelle/apps/sp_fr/xsd.py | ||
---|---|---|
66 | 66 |
} |
67 | 67 | |
68 | 68 | |
69 |
class Schema(object):
|
|
69 |
class Schema: |
|
70 | 70 |
def __init__(self): |
71 | 71 |
self.types = {} |
72 | 72 |
self.elements = {} |
... | ... | |
293 | 293 | |
294 | 294 | |
295 | 295 |
@six.python_2_unicode_compatible |
296 |
class Path(object):
|
|
296 |
class Path: |
|
297 | 297 |
def __init__(self, path, xsd_type): |
298 | 298 |
assert path |
299 | 299 |
self.path = path |
passerelle/base/__init__.py | ||
---|---|---|
19 | 19 |
from django.utils.module_loading import import_string |
20 | 20 | |
21 | 21 | |
22 |
class ConnectorAppMixin(object):
|
|
22 |
class ConnectorAppMixin: |
|
23 | 23 |
def get_connector_model(self): |
24 | 24 |
return self._connector_model |
25 | 25 |
passerelle/base/forms.py | ||
---|---|---|
54 | 54 |
import_users = forms.BooleanField(label=_('Import users and access rights'), required=False) |
55 | 55 | |
56 | 56 | |
57 |
class BaseQueryFormMixin(object):
|
|
57 |
class BaseQueryFormMixin: |
|
58 | 58 |
def clean_slug(self): |
59 | 59 |
slug = self.cleaned_data['slug'] |
60 | 60 |
passerelle/base/mixins.py | ||
---|---|---|
17 | 17 |
from django.utils import functional |
18 | 18 | |
19 | 19 | |
20 |
class ResourceChildViewMixin(object):
|
|
20 |
class ResourceChildViewMixin: |
|
21 | 21 |
'''Mixin to help implementing view for child objects of resource objets.''' |
22 | 22 | |
23 | 23 |
@property |
passerelle/base/models.py | ||
---|---|---|
906 | 906 |
return self.status == 'down' |
907 | 907 | |
908 | 908 | |
909 |
class ProxyLogger(object):
|
|
909 |
class ProxyLogger: |
|
910 | 910 |
def __init__(self, connector, extra=None, transaction_id=None): |
911 | 911 |
self.connector = connector |
912 | 912 |
self.appname = connector.get_connector_slug() |
passerelle/contrib/dpark/models.py | ||
---|---|---|
36 | 36 |
from passerelle.views import WrongParameter |
37 | 37 | |
38 | 38 | |
39 |
class Error(object):
|
|
39 |
class Error: |
|
40 | 40 |
def __init__(self, code, msg=None): |
41 | 41 |
self.code = code |
42 | 42 |
self.msg = msg |
passerelle/contrib/greco/formdata.py | ||
---|---|---|
87 | 87 |
yield fieldname[0] if isinstance(fieldname, tuple) else fieldname |
88 | 88 | |
89 | 89 | |
90 |
class FormData(object):
|
|
90 |
class FormData: |
|
91 | 91 |
def __init__(self, formdata, schema): |
92 | 92 |
if not isinstance(formdata, dict): |
93 | 93 |
raise ValueError('formdata must be a dict') |
passerelle/contrib/planitech/mste.py | ||
---|---|---|
62 | 62 |
pass |
63 | 63 | |
64 | 64 | |
65 |
class MSTEDecoder(object):
|
|
65 |
class MSTEDecoder: |
|
66 | 66 |
def __init__(self, data): |
67 | 67 |
self._idx = 4 |
68 | 68 |
self._keys = [] |
... | ... | |
171 | 171 |
return None |
172 | 172 | |
173 | 173 | |
174 |
class MSTEEncoder(object):
|
|
174 |
class MSTEEncoder: |
|
175 | 175 |
def __init__(self, data): |
176 | 176 |
self._data = data |
177 | 177 |
self._stream = [] |
passerelle/contrib/utils/axel.py | ||
---|---|---|
196 | 196 |
OperationResult = namedtuple('OperationResult', ['json_response', 'xml_request', 'xml_response']) |
197 | 197 | |
198 | 198 | |
199 |
class Operation(object):
|
|
199 |
class Operation: |
|
200 | 200 |
base_xsd_path = None |
201 | 201 |
default_prefix = '' |
202 | 202 |
axel_schema = AxelSchema |
passerelle/utils/api.py | ||
---|---|---|
26 | 26 |
from .jsonresponse import APIError # noqa pylint: disable=unused-import |
27 | 27 | |
28 | 28 | |
29 |
class endpoint(object):
|
|
29 |
class endpoint: |
|
30 | 30 |
do_not_call_in_templates = True |
31 | 31 | |
32 | 32 |
def __init__( |
passerelle/utils/jsonresponse.py | ||
---|---|---|
45 | 45 |
return super().default(o) |
46 | 46 | |
47 | 47 | |
48 |
class to_json(object):
|
|
48 |
class to_json: |
|
49 | 49 |
def __init__(self, error_code=500, logger=None, **kwargs): |
50 | 50 |
self.error_code = error_code |
51 | 51 |
self.kwargs = kwargs |
passerelle/utils/sftp.py | ||
---|---|---|
60 | 60 | |
61 | 61 | |
62 | 62 |
@six.python_2_unicode_compatible |
63 |
class SFTP(object):
|
|
63 |
class SFTP: |
|
64 | 64 |
def __init__(self, url, private_key_content=None, private_key_password=None): |
65 | 65 |
self.url = url |
66 | 66 |
parsed = urlparse.urlparse(url) |
passerelle/utils/wcs.py | ||
---|---|---|
40 | 40 |
pass |
41 | 41 | |
42 | 42 | |
43 |
class JSONFile(object):
|
|
43 |
class JSONFile: |
|
44 | 44 |
def __init__(self, d): |
45 | 45 |
self.d = d |
46 | 46 | |
... | ... | |
68 | 68 |
return o |
69 | 69 | |
70 | 70 | |
71 |
class BaseObject(object):
|
|
71 |
class BaseObject: |
|
72 | 72 |
def __init__(self, wcs_api, **kwargs): |
73 | 73 |
self._wcs_api = wcs_api |
74 | 74 |
self.__dict__.update(**kwargs) |
... | ... | |
228 | 228 |
self.geolocations = sorted((k, v) for k, v in (self.geolocations or {}).items()) |
229 | 229 | |
230 | 230 | |
231 |
class FormDatas(object):
|
|
231 |
class FormDatas: |
|
232 | 232 |
def __init__(self, wcs_api, formdef, full=False, anonymize=False, batch=1000): |
233 | 233 |
self.wcs_api = wcs_api |
234 | 234 |
self.formdef = formdef |
... | ... | |
307 | 307 |
pass |
308 | 308 | |
309 | 309 | |
310 |
class FormDefSubmit(object):
|
|
310 |
class FormDefSubmit: |
|
311 | 311 |
formdef = None |
312 | 312 |
data = None |
313 | 313 |
user_email = None |
... | ... | |
498 | 498 |
pass |
499 | 499 | |
500 | 500 | |
501 |
class WcsObjects(object):
|
|
501 |
class WcsObjects: |
|
502 | 502 |
url = None |
503 | 503 |
object_class = None |
504 | 504 | |
... | ... | |
537 | 537 |
object_class = Category |
538 | 538 | |
539 | 539 | |
540 |
class WcsApi(object):
|
|
540 |
class WcsApi: |
|
541 | 541 |
def __init__( |
542 | 542 |
self, url, email=None, name_id=None, batch_size=1000, session=None, logger=None, orig=None, key=None |
543 | 543 |
): |
... | ... | |
643 | 643 | |
644 | 644 | |
645 | 645 |
@six.python_2_unicode_compatible |
646 |
class FormDefRef(object):
|
|
646 |
class FormDefRef: |
|
647 | 647 |
_formdef = None |
648 | 648 |
_api = None |
649 | 649 |
session = None |
passerelle/utils/xml.py | ||
---|---|---|
130 | 130 |
return super().element_encode(obj, xsd_element, *args) |
131 | 131 | |
132 | 132 | |
133 |
class JSONSchemaFromXMLSchema(object):
|
|
133 |
class JSONSchemaFromXMLSchema: |
|
134 | 134 |
SIMPLE_TYPE_MAPPING = { |
135 | 135 |
xmlschema_names.XSD_STRING: 'string', |
136 | 136 |
xmlschema_names.XSD_INTEGER: 'integer', |
passerelle/utils/zip.py | ||
---|---|---|
93 | 93 | |
94 | 94 | |
95 | 95 |
@python_2_unicode_compatible |
96 |
class ZipPart(object):
|
|
96 |
class ZipPart: |
|
97 | 97 |
def __init__(self, zip_template, name_template, template_path=None, content_expression=None): |
98 | 98 |
self.zip_template = zip_template |
99 | 99 |
self._name_template = name_template |
... | ... | |
164 | 164 |
return s.format(self) |
165 | 165 | |
166 | 166 | |
167 |
class ZipTemplate(object):
|
|
167 |
class ZipTemplate: |
|
168 | 168 |
def __init__(self, manifest, ctx=None): |
169 | 169 |
if manifest.startswith('/'): |
170 | 170 |
path = manifest |
passerelle/views.py | ||
---|---|---|
149 | 149 |
return context |
150 | 150 | |
151 | 151 | |
152 |
class GenericConnectorMixin(object):
|
|
152 |
class GenericConnectorMixin: |
|
153 | 153 |
exclude_fields = ('slug', 'users') |
154 | 154 | |
155 | 155 |
def get_connector(self, **kwargs): |
tests/test_astregs.py | ||
---|---|---|
815 | 815 |
mock_operation_result = mock.Mock(liste=False, EncodeKeyContact=False) |
816 | 816 |
mock_operation = mock.Mock(return_value=mock_operation_result) |
817 | 817 | |
818 |
class MockService(object):
|
|
818 |
class MockService: |
|
819 | 819 |
def __getattr__(self, name): |
820 | 820 |
return mock_operation |
821 | 821 |
tests/test_atal.py | ||
---|---|---|
40 | 40 |
return mock_soap_call |
41 | 41 | |
42 | 42 | |
43 |
class SoapElem(object):
|
|
43 |
class SoapElem: |
|
44 | 44 |
def __init__(self, **kwargs): |
45 | 45 |
for attr, value in kwargs.items(): |
46 | 46 |
setattr(self, attr, value) |
tests/test_atos_genesys.py | ||
---|---|---|
224 | 224 |
freezer.move_to('2018-01-01 00:00:00') |
225 | 225 |
link = Link.objects.create(resource=genesys, name_id='zob', id_per='4567') |
226 | 226 | |
227 |
class F(object):
|
|
227 |
class F: |
|
228 | 228 |
calls = 0 |
229 | 229 |
value = 1 |
230 | 230 |
tests/test_cmis.py | ||
---|---|---|
44 | 44 | |
45 | 45 | |
46 | 46 |
def test_uploadfile(app, setup, tmpdir, monkeypatch): |
47 |
class FakeCMISGateway(object):
|
|
47 |
class FakeCMISGateway: |
|
48 | 48 |
def __init__(self, *args, **kwargs): |
49 | 49 |
pass |
50 | 50 |
tests/test_dpark.py | ||
---|---|---|
82 | 82 |
pass |
83 | 83 | |
84 | 84 | |
85 |
class MockedService(object):
|
|
85 |
class MockedService: |
|
86 | 86 |
def __init__(self, success, error_class, replydata): |
87 | 87 |
self.success = success |
88 | 88 |
self.error_class = error_class |
tests/test_generic_endpoint.py | ||
---|---|---|
204 | 204 |
assert record.message == 'endpoint PATCH /arcgis/test/mapservice-query (=> 405)' |
205 | 205 | |
206 | 206 | |
207 |
class FakeConnectorBase(object):
|
|
207 |
class FakeConnectorBase: |
|
208 | 208 |
slug = 'connector' |
209 | 209 | |
210 | 210 |
def get_connector_slug(self): |
... | ... | |
348 | 348 |
assert connector.foo9.endpoint_info.long_description == 'foo9 post' |
349 | 349 | |
350 | 350 | |
351 |
class FakeJSONConnector(object):
|
|
351 |
class FakeJSONConnector: |
|
352 | 352 |
slug = 'connector-json' |
353 | 353 |
log_level = 'DEBUG' |
354 | 354 | |
... | ... | |
444 | 444 |
assert resp.json['data'] == {'foo': [{'id': 42, 'bar': True}]} |
445 | 445 | |
446 | 446 | |
447 |
class FakeConnectorDatasource(object):
|
|
447 |
class FakeConnectorDatasource: |
|
448 | 448 |
slug = 'connector-datasource' |
449 | 449 |
log_level = 'DEBUG' |
450 | 450 | |
... | ... | |
627 | 627 |
connector = StubInvoicesConnector(slug='fake') |
628 | 628 |
connector.save() |
629 | 629 | |
630 |
class TestCache(object):
|
|
630 |
class TestCache: |
|
631 | 631 |
def __init__(self): |
632 | 632 |
self.d = dict() |
633 | 633 |
self.get_calls = 0 |
tests/test_iparapheur.py | ||
---|---|---|
84 | 84 |
service = mock.Mock() |
85 | 85 |
service.echo.return_value = 'pong' |
86 | 86 | |
87 |
class MockedSettings(object):
|
|
87 |
class MockedSettings: |
|
88 | 88 |
def __init__(self, **kwargs): |
89 | 89 |
pass |
90 | 90 |
tests/test_mdph13.py | ||
---|---|---|
208 | 208 | |
209 | 209 |
@pytest.fixture |
210 | 210 |
def mock_http(): |
211 |
class MockHttp(object):
|
|
211 |
class MockHttp: |
|
212 | 212 |
def __init__(self): |
213 | 213 |
self.requests = [] |
214 | 214 |
self.responses = [] |
tests/test_planitech.py | ||
---|---|---|
245 | 245 | |
246 | 246 | |
247 | 247 |
def test_call_planitech(connector, monkeypatch): |
248 |
class MockResponse(object):
|
|
248 |
class MockResponse: |
|
249 | 249 | |
250 | 250 |
status_code = 200 |
251 | 251 |
content = None |
tests/test_requests.py | ||
---|---|---|
18 | 18 |
Request.ADAPTER_REGISTRY.clear() |
19 | 19 | |
20 | 20 | |
21 |
class MockFileField(object):
|
|
21 |
class MockFileField: |
|
22 | 22 |
def __init__(self, path): |
23 | 23 |
self.path = path |
24 | 24 | |
25 | 25 | |
26 |
class MockResource(object):
|
|
26 |
class MockResource: |
|
27 | 27 |
logger = logging.getLogger('requests') |
28 | 28 |
basic_auth_username = '' |
29 | 29 |
basic_auth_password = '' |
tests/test_soap.py | ||
---|---|---|
34 | 34 |
pass |
35 | 35 | |
36 | 36 | |
37 |
class SOAPResource(object):
|
|
37 |
class SOAPResource: |
|
38 | 38 |
def __init__(self): |
39 | 39 |
self.requests = requests.Session() |
40 | 40 |
self.wsdl_url = WSDL |
41 |
- |