mirror of https://github.com/MISP/PyTaxonomies
fix: Use collections.abc instead of collections
parent
a48ea9d5ec
commit
5b3573c2d8
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import collections
|
from collections.abc import Mapping
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from json import JSONEncoder
|
from json import JSONEncoder
|
||||||
|
@ -65,7 +65,7 @@ class Entry():
|
||||||
return self.value
|
return self.value
|
||||||
|
|
||||||
|
|
||||||
class Predicate(collections.Mapping):
|
class Predicate(Mapping):
|
||||||
|
|
||||||
def __init__(self, predicate: Optional[Dict[str, str]]=None,
|
def __init__(self, predicate: Optional[Dict[str, str]]=None,
|
||||||
entries: Optional[List[Dict[str, str]]]=None):
|
entries: Optional[List[Dict[str, str]]]=None):
|
||||||
|
@ -124,7 +124,7 @@ class Predicate(collections.Mapping):
|
||||||
return len(self.entries)
|
return len(self.entries)
|
||||||
|
|
||||||
|
|
||||||
class Taxonomy(collections.Mapping):
|
class Taxonomy(Mapping):
|
||||||
|
|
||||||
def __init__(self, taxonomy=None):
|
def __init__(self, taxonomy=None):
|
||||||
if not taxonomy:
|
if not taxonomy:
|
||||||
|
@ -233,7 +233,7 @@ class Taxonomy(collections.Mapping):
|
||||||
return to_return
|
return to_return
|
||||||
|
|
||||||
|
|
||||||
class Taxonomies(collections.Mapping):
|
class Taxonomies(Mapping):
|
||||||
|
|
||||||
def __init__(self, manifest_url: str='https://raw.githubusercontent.com/MISP/misp-taxonomies/master/MANIFEST.json',
|
def __init__(self, manifest_url: str='https://raw.githubusercontent.com/MISP/misp-taxonomies/master/MANIFEST.json',
|
||||||
manifest_path: Union[Path, str]=Path(os.path.abspath(os.path.dirname(sys.modules['pytaxonomies'].__file__))) / 'data' / 'misp-taxonomies' / 'MANIFEST.json'):
|
manifest_path: Union[Path, str]=Path(os.path.abspath(os.path.dirname(sys.modules['pytaxonomies'].__file__))) / 'data' / 'misp-taxonomies' / 'MANIFEST.json'):
|
||||||
|
|
Loading…
Reference in New Issue