PyPaf 1.0.0__tar.gz → 1.0.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {PyPaf-1.0.0/src/PyPaf.egg-info → pypaf-1.0.2}/PKG-INFO +2 -2
- {PyPaf-1.0.0 → pypaf-1.0.2/src/PyPaf.egg-info}/PKG-INFO +2 -2
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/__init__.py +10 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/exception.py +6 -1
- pypaf-1.0.2/src/paf/premises/extender.py +23 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule110.py +7 -2
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/split.py +13 -0
- pypaf-1.0.2/src/paf/version.py +3 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_3.py +155 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_6.py +70 -0
- PyPaf-1.0.0/src/paf/premises/extender.py +0 -26
- PyPaf-1.0.0/src/paf/version.py +0 -3
- {PyPaf-1.0.0 → pypaf-1.0.2}/LICENSE.txt +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/README.md +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/pyproject.toml +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/setup.cfg +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/PyPaf.egg-info/SOURCES.txt +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/PyPaf.egg-info/dependency_links.txt +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/PyPaf.egg-info/top_level.txt +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/__init__.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/address.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/attribute.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/immutable.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/initiator.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/lineable.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/attribute.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/building_type.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/dependent_premisable.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/lineable.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/premisable.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule000.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule001.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule010.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule011.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule100.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule101.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/premises/rule111.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/src/paf/thoroughfare_locality.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_empty.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_exception_i.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_exception_ii.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_exception_iii.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_exception_iv.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_immutability.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_kwargs.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_mainfile.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_po_box.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_premises.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_1.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_2.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_4.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_5.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_7.py +0 -0
- {PyPaf-1.0.0 → pypaf-1.0.2}/tests/test_rule_x.py +0 -0
|
@@ -79,6 +79,11 @@ class Premises(
|
|
|
79
79
|
"""Returns sub-building number and first thoroughfare or locality"""
|
|
80
80
|
return self._concatenate(('sub_building_name', 'first_thoroughfare_or_locality'))
|
|
81
81
|
|
|
82
|
+
@property
|
|
83
|
+
def sub_and_building_name_but_last_word(self):
|
|
84
|
+
"""Returns sub-building name and but last word of the building name"""
|
|
85
|
+
return self._concatenate(('sub_building_name', 'building_name_but_last_word'))
|
|
86
|
+
|
|
82
87
|
@property
|
|
83
88
|
def building_name_but_last_word(self):
|
|
84
89
|
"""Returns all but last word of the building name"""
|
|
@@ -89,6 +94,11 @@ class Premises(
|
|
|
89
94
|
"""Returns last word of the building name"""
|
|
90
95
|
return self.last_word('building_name')
|
|
91
96
|
|
|
97
|
+
@property
|
|
98
|
+
def building_name_last_two_words(self):
|
|
99
|
+
"""Returns last two words of the building name"""
|
|
100
|
+
return self.last_two_words('building_name')
|
|
101
|
+
|
|
92
102
|
@property
|
|
93
103
|
def sub_building_name_but_last_word(self):
|
|
94
104
|
"""Returns all but last word of the sub-building name"""
|
|
@@ -46,7 +46,12 @@ class ExceptionMixin(BuildingTypeMixin, SplitMixin):
|
|
|
46
46
|
def is_split_exception(self, attr):
|
|
47
47
|
"""Returns if attribute should be split"""
|
|
48
48
|
return (
|
|
49
|
-
self.
|
|
49
|
+
(self.__is_exception_i(self.last_word(attr))
|
|
50
|
+
or self.__is_exception_ii(self.last_word(attr)))
|
|
50
51
|
and not self.last_word(attr).isdigit()
|
|
51
52
|
and not self.__is_exception_iv(attr)
|
|
53
|
+
and (
|
|
54
|
+
attr != 'building_name'
|
|
55
|
+
or not self.is_known_building_type('building_name_last_two_words')
|
|
56
|
+
)
|
|
52
57
|
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Premises Extender Mixin"""
|
|
2
|
+
|
|
3
|
+
import sys
|
|
4
|
+
import importlib
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ExtenderMixin():
|
|
8
|
+
"""Dynamic Premises processing"""
|
|
9
|
+
|
|
10
|
+
@property
|
|
11
|
+
def rule(self):
|
|
12
|
+
"""Returns premises rule class"""
|
|
13
|
+
rule_num = ''.join(['0' if self.is_empty(k) else '1' for k in self.building_attrs])
|
|
14
|
+
package_name = getattr(sys.modules[__name__], '__package__', None)
|
|
15
|
+
module_name = f'rule{rule_num}'
|
|
16
|
+
module = importlib.import_module(f'{package_name}.{module_name}')
|
|
17
|
+
class_name = f'Rule{rule_num}'
|
|
18
|
+
return getattr(module, class_name)
|
|
19
|
+
|
|
20
|
+
def extend(self):
|
|
21
|
+
"""Dynamically extends instance with appropriate rule"""
|
|
22
|
+
base_cls = self.__class__
|
|
23
|
+
object.__setattr__(self, '__class__', type(base_cls.__name__, (base_cls, self.rule), {}))
|
|
@@ -10,6 +10,11 @@ class Rule110(PremisableMixin):
|
|
|
10
10
|
def rule_attrs(self):
|
|
11
11
|
"""Returns premises list"""
|
|
12
12
|
if self.is_exception('sub_building_name'):
|
|
13
|
+
if self.is_split_exception('building_name'):
|
|
14
|
+
return (
|
|
15
|
+
'sub_and_building_name_but_last_word',
|
|
16
|
+
'name_last_word_and_thoroughfare_or_locality'
|
|
17
|
+
)
|
|
13
18
|
return ('sub_name_and_name',)
|
|
14
19
|
if self.is_exception('building_name'):
|
|
15
20
|
return ('sub_building_name', 'name_and_thoroughfare_or_locality')
|
|
@@ -24,6 +29,6 @@ class Rule110(PremisableMixin):
|
|
|
24
29
|
def includes_first_thoroughfare_or_locality(self):
|
|
25
30
|
"""Returns if premises includes first thoroughfare or locality"""
|
|
26
31
|
return (
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
self.is_split_exception('building_name')
|
|
33
|
+
or (not self.is_exception('sub_building_name') and self.is_exception('building_name'))
|
|
29
34
|
)
|
|
@@ -24,6 +24,15 @@ class SplitMixin():
|
|
|
24
24
|
except ValueError:
|
|
25
25
|
return string
|
|
26
26
|
|
|
27
|
+
@classmethod
|
|
28
|
+
def __last_two_words(cls, string):
|
|
29
|
+
"""Returns last two words of the string"""
|
|
30
|
+
try:
|
|
31
|
+
*_, penultimate, last = string.split()
|
|
32
|
+
return ' '.join([penultimate, last])
|
|
33
|
+
except ValueError:
|
|
34
|
+
return cls.__last_word(string)
|
|
35
|
+
|
|
27
36
|
@classmethod
|
|
28
37
|
def __leading_digits(cls, string):
|
|
29
38
|
"""Returns the leading digits from the string"""
|
|
@@ -49,6 +58,10 @@ class SplitMixin():
|
|
|
49
58
|
"""Returns last word of the attribute"""
|
|
50
59
|
return self.__last_word(str(getattr(self, attr, '')))
|
|
51
60
|
|
|
61
|
+
def last_two_words(self, attr):
|
|
62
|
+
"""Returns last two word of the attribute"""
|
|
63
|
+
return self.__last_two_words(str(getattr(self, attr, '')))
|
|
64
|
+
|
|
52
65
|
def leading_digits(self, attr):
|
|
53
66
|
"""Returns the leading digits from the attribute"""
|
|
54
67
|
return self.__leading_digits(str(getattr(self, attr, '')))
|
|
@@ -274,5 +274,160 @@ class TestRule3WithoutSplit(unittest.TestCase):
|
|
|
274
274
|
)
|
|
275
275
|
|
|
276
276
|
|
|
277
|
+
class TestRule3WithoutCharSplit(unittest.TestCase):
|
|
278
|
+
"""Test Address Rule 3 without Character Split Exception"""
|
|
279
|
+
|
|
280
|
+
@classmethod
|
|
281
|
+
def setUpClass(cls):
|
|
282
|
+
"""Set up Address instance"""
|
|
283
|
+
cls.address = paf.Address({
|
|
284
|
+
'organisation_name': "JOBCENTRE PLUS",
|
|
285
|
+
'building_name': "ABERDEEN B D C",
|
|
286
|
+
'thoroughfare_name': "WELLINGTON",
|
|
287
|
+
'thoroughfare_descriptor': "CIRCLE",
|
|
288
|
+
'post_town': "ABERDEEN",
|
|
289
|
+
'postcode': "AB99 8AB"
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
def test_list(self):
|
|
293
|
+
"""Test conversion to an list"""
|
|
294
|
+
address = [
|
|
295
|
+
"JOBCENTRE PLUS",
|
|
296
|
+
"ABERDEEN B D C",
|
|
297
|
+
"WELLINGTON CIRCLE",
|
|
298
|
+
"ABERDEEN",
|
|
299
|
+
"AB99 8AB"
|
|
300
|
+
]
|
|
301
|
+
self.assertEqual(
|
|
302
|
+
self.address.as_list(), address, "Incorrect Rule 3 w/o char split list format"
|
|
303
|
+
)
|
|
304
|
+
|
|
305
|
+
def test_string(self):
|
|
306
|
+
"""Test conversion to a string"""
|
|
307
|
+
address = (
|
|
308
|
+
"JOBCENTRE PLUS, "
|
|
309
|
+
"ABERDEEN B D C, "
|
|
310
|
+
"WELLINGTON CIRCLE, "
|
|
311
|
+
"ABERDEEN. "
|
|
312
|
+
"AB99 8AB"
|
|
313
|
+
)
|
|
314
|
+
self.assertEqual(
|
|
315
|
+
self.address.as_str(), address, "Incorrect Rule 3 w/o char split string format"
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
def test_tuple(self):
|
|
319
|
+
"""Test conversion to a tuple"""
|
|
320
|
+
address = (
|
|
321
|
+
"JOBCENTRE PLUS",
|
|
322
|
+
"ABERDEEN B D C",
|
|
323
|
+
"WELLINGTON CIRCLE",
|
|
324
|
+
"ABERDEEN",
|
|
325
|
+
"AB99 8AB"
|
|
326
|
+
)
|
|
327
|
+
self.assertEqual(
|
|
328
|
+
self.address.as_tuple(), address, "Incorrect Rule 3 w/o char split tuple format"
|
|
329
|
+
)
|
|
330
|
+
|
|
331
|
+
def test_dict(self):
|
|
332
|
+
"""Test conversion to a dict"""
|
|
333
|
+
address = {
|
|
334
|
+
'line_1': "JOBCENTRE PLUS",
|
|
335
|
+
'line_2': "ABERDEEN B D C",
|
|
336
|
+
'line_3': "WELLINGTON CIRCLE",
|
|
337
|
+
'post_town': "ABERDEEN",
|
|
338
|
+
'postcode': "AB99 8AB"
|
|
339
|
+
}
|
|
340
|
+
self.assertEqual(
|
|
341
|
+
self.address.as_dict(), address, "Incorrect Rule 3 w/o char split dict format"
|
|
342
|
+
)
|
|
343
|
+
|
|
344
|
+
def test_premises(self):
|
|
345
|
+
"""Test premises"""
|
|
346
|
+
premises = {'premises_name': 'ABERDEEN B D C'}
|
|
347
|
+
self.assertEqual(
|
|
348
|
+
self.address.premises(), premises, "Incorrect Rule 3 w/o char split premises"
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
class TestRule3WithoutTypeSplit(unittest.TestCase):
|
|
353
|
+
"""Test Address Rule 3 without Building Type Split Exception"""
|
|
354
|
+
|
|
355
|
+
@classmethod
|
|
356
|
+
def setUpClass(cls):
|
|
357
|
+
"""Set up Address instance"""
|
|
358
|
+
cls.address = paf.Address({
|
|
359
|
+
'organisation_name': "P S G MARINE & LOGISTICS LTD",
|
|
360
|
+
'building_name': "PORT SERVICES HOUSE UNIT 14A",
|
|
361
|
+
'thoroughfare_name': "PETERSEAT",
|
|
362
|
+
'thoroughfare_descriptor': "DRIVE",
|
|
363
|
+
'dependent_locality': "ALTENS INDUSTRIAL ESTATE",
|
|
364
|
+
'post_town': "ABERDEEN",
|
|
365
|
+
'postcode': "AB12 3HT"
|
|
366
|
+
})
|
|
367
|
+
|
|
368
|
+
def test_list(self):
|
|
369
|
+
"""Test conversion to an list"""
|
|
370
|
+
address = [
|
|
371
|
+
"P S G MARINE & LOGISTICS LTD",
|
|
372
|
+
"PORT SERVICES HOUSE UNIT 14A",
|
|
373
|
+
"PETERSEAT DRIVE",
|
|
374
|
+
"ALTENS INDUSTRIAL ESTATE",
|
|
375
|
+
"ABERDEEN",
|
|
376
|
+
"AB12 3HT"
|
|
377
|
+
]
|
|
378
|
+
self.assertEqual(
|
|
379
|
+
self.address.as_list(), address, "Incorrect Rule 3 w/o type split list format"
|
|
380
|
+
)
|
|
381
|
+
|
|
382
|
+
def test_string(self):
|
|
383
|
+
"""Test conversion to a string"""
|
|
384
|
+
address = (
|
|
385
|
+
"P S G MARINE & LOGISTICS LTD, "
|
|
386
|
+
"PORT SERVICES HOUSE UNIT 14A, "
|
|
387
|
+
"PETERSEAT DRIVE, "
|
|
388
|
+
"ALTENS INDUSTRIAL ESTATE, "
|
|
389
|
+
"ABERDEEN. "
|
|
390
|
+
"AB12 3HT"
|
|
391
|
+
)
|
|
392
|
+
self.assertEqual(
|
|
393
|
+
self.address.as_str(), address, "Incorrect Rule 3 w/o type split string format"
|
|
394
|
+
)
|
|
395
|
+
|
|
396
|
+
def test_tuple(self):
|
|
397
|
+
"""Test conversion to a tuple"""
|
|
398
|
+
address = (
|
|
399
|
+
"P S G MARINE & LOGISTICS LTD",
|
|
400
|
+
"PORT SERVICES HOUSE UNIT 14A",
|
|
401
|
+
"PETERSEAT DRIVE",
|
|
402
|
+
"ALTENS INDUSTRIAL ESTATE",
|
|
403
|
+
"ABERDEEN",
|
|
404
|
+
"AB12 3HT"
|
|
405
|
+
)
|
|
406
|
+
self.assertEqual(
|
|
407
|
+
self.address.as_tuple(), address, "Incorrect Rule 3 w/o type split tuple format"
|
|
408
|
+
)
|
|
409
|
+
|
|
410
|
+
def test_dict(self):
|
|
411
|
+
"""Test conversion to a dict"""
|
|
412
|
+
address = {
|
|
413
|
+
'line_1': "P S G MARINE & LOGISTICS LTD",
|
|
414
|
+
'line_2': "PORT SERVICES HOUSE UNIT 14A",
|
|
415
|
+
'line_3': "PETERSEAT DRIVE",
|
|
416
|
+
'line_4': "ALTENS INDUSTRIAL ESTATE",
|
|
417
|
+
'post_town': "ABERDEEN",
|
|
418
|
+
'postcode': "AB12 3HT"
|
|
419
|
+
}
|
|
420
|
+
self.assertEqual(
|
|
421
|
+
self.address.as_dict(), address, "Incorrect Rule 3 w/o type split dict format"
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
def test_premises(self):
|
|
425
|
+
"""Test premises"""
|
|
426
|
+
premises = {'premises_name': 'PORT SERVICES HOUSE UNIT 14A'}
|
|
427
|
+
self.assertEqual(
|
|
428
|
+
self.address.premises(), premises, "Incorrect Rule 3 w/o type split premises"
|
|
429
|
+
)
|
|
430
|
+
|
|
431
|
+
|
|
277
432
|
if __name__ == '__main__':
|
|
278
433
|
unittest.main()
|
|
@@ -216,6 +216,76 @@ class TestRule6WithSplitException(unittest.TestCase):
|
|
|
216
216
|
self.address.premises(), premises, "Incorrect Rule 6 w/ split building premises")
|
|
217
217
|
|
|
218
218
|
|
|
219
|
+
class TestRule6WithDoubleException(unittest.TestCase):
|
|
220
|
+
"""Test Address Rule 6 with Double Building Name Exception"""
|
|
221
|
+
|
|
222
|
+
@classmethod
|
|
223
|
+
def setUpClass(cls):
|
|
224
|
+
"""Set up Address instance"""
|
|
225
|
+
cls.address = paf.Address({
|
|
226
|
+
'sub_building_name': "91",
|
|
227
|
+
'building_name': "OCEAN APARTMENTS 52-54",
|
|
228
|
+
'thoroughfare_name': "PARK",
|
|
229
|
+
'thoroughfare_descriptor': "ROAD",
|
|
230
|
+
'post_town': "ABERDEEN",
|
|
231
|
+
'postcode': "AB24 5RZ"
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
def test_list(self):
|
|
235
|
+
"""Test conversion to an list"""
|
|
236
|
+
address = [
|
|
237
|
+
"91 OCEAN APARTMENTS",
|
|
238
|
+
"52-54 PARK ROAD",
|
|
239
|
+
"ABERDEEN",
|
|
240
|
+
"AB24 5RZ"
|
|
241
|
+
]
|
|
242
|
+
self.assertEqual(
|
|
243
|
+
self.address.as_list(), address, "Incorrect Rule 6 w/ double building list format"
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
def test_string(self):
|
|
247
|
+
"""Test conversion to a string"""
|
|
248
|
+
address = "91 OCEAN APARTMENTS, 52-54 PARK ROAD, ABERDEEN. AB24 5RZ"
|
|
249
|
+
self.assertEqual(
|
|
250
|
+
self.address.as_str(), address, "Incorrect Rule 6 w/ double building string format"
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
def test_tuple(self):
|
|
254
|
+
"""Test conversion to a tuple"""
|
|
255
|
+
address = (
|
|
256
|
+
"91 OCEAN APARTMENTS",
|
|
257
|
+
"52-54 PARK ROAD",
|
|
258
|
+
"ABERDEEN",
|
|
259
|
+
"AB24 5RZ"
|
|
260
|
+
)
|
|
261
|
+
self.assertEqual(
|
|
262
|
+
self.address.as_tuple(), address, "Incorrect Rule 6 w/ double building tuple format"
|
|
263
|
+
)
|
|
264
|
+
|
|
265
|
+
def test_dict(self):
|
|
266
|
+
"""Test conversion to a dict"""
|
|
267
|
+
address = {
|
|
268
|
+
'line_1': "91 OCEAN APARTMENTS",
|
|
269
|
+
'line_2': "52-54 PARK ROAD",
|
|
270
|
+
'post_town': "ABERDEEN",
|
|
271
|
+
'postcode': "AB24 5RZ"
|
|
272
|
+
}
|
|
273
|
+
self.assertEqual(
|
|
274
|
+
self.address.as_dict(), address, "Incorrect Rule 6 w/ double building dict format"
|
|
275
|
+
)
|
|
276
|
+
|
|
277
|
+
def test_premises(self):
|
|
278
|
+
"""Test premises"""
|
|
279
|
+
premises = {
|
|
280
|
+
'premises_number': 52,
|
|
281
|
+
'premises_suffix': '-54',
|
|
282
|
+
'premises_name': 'OCEAN APARTMENTS',
|
|
283
|
+
'sub_premises_number': 91
|
|
284
|
+
}
|
|
285
|
+
self.assertEqual(
|
|
286
|
+
self.address.premises(), premises, "Incorrect Rule 6 w/ split building premises")
|
|
287
|
+
|
|
288
|
+
|
|
219
289
|
class TestRule6(unittest.TestCase):
|
|
220
290
|
"""Test Address Rule 6 without Exception"""
|
|
221
291
|
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"""Premises Extender Mixin"""
|
|
2
|
-
|
|
3
|
-
import sys
|
|
4
|
-
from .rule000 import Rule000 # pylint: disable=unused-import # noqa: F401
|
|
5
|
-
from .rule001 import Rule001 # pylint: disable=unused-import # noqa: F401
|
|
6
|
-
from .rule010 import Rule010 # pylint: disable=unused-import # noqa: F401
|
|
7
|
-
from .rule100 import Rule100 # pylint: disable=unused-import # noqa: F401
|
|
8
|
-
from .rule011 import Rule011 # pylint: disable=unused-import # noqa: F401
|
|
9
|
-
from .rule101 import Rule101 # pylint: disable=unused-import # noqa: F401
|
|
10
|
-
from .rule110 import Rule110 # pylint: disable=unused-import # noqa: F401
|
|
11
|
-
from .rule111 import Rule111 # pylint: disable=unused-import # noqa: F401
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class ExtenderMixin():
|
|
15
|
-
"""Dynamic Premises processing"""
|
|
16
|
-
|
|
17
|
-
@property
|
|
18
|
-
def rule(self):
|
|
19
|
-
"""Returns premises rule class"""
|
|
20
|
-
rule = ''.join(['0' if self.is_empty(k) else '1' for k in self.building_attrs])
|
|
21
|
-
return getattr(sys.modules[__name__], 'Rule' + rule)
|
|
22
|
-
|
|
23
|
-
def extend(self):
|
|
24
|
-
"""Dynamically extends instance with appropriate rule"""
|
|
25
|
-
base_cls = self.__class__
|
|
26
|
-
object.__setattr__(self, '__class__', type(base_cls.__name__, (base_cls, self.rule), {}))
|
PyPaf-1.0.0/src/paf/version.py
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|