Skip to content

Commit

Permalink
Fix for wildcard subdomain matching
Browse files Browse the repository at this point in the history
Also:
* New PyPI release with updated classifiers
* New service provider
* Fixed test script
  • Loading branch information
jace committed Nov 8, 2018
1 parent 9510e2d commit 84efc5c
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 6 deletions.
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ python:
# command to install dependencies
install:
- python setup.py develop
- pip install nose coverage coveralls
- pip install pytest coverage coveralls
script:
- coverage run `which nosetests`
- coverage report -m
- ./runtests.sh
after_success:
- coveralls
notifications:
Expand Down
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
0.3.5
=====

* Fixed wildcard subdomain matching
* New service provider
* Updated PyPI classifiers

0.3.4
=====

Expand Down
6 changes: 6 additions & 0 deletions mxsniff/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ class WildcardDomainDict(object):
'example-wildcard'
>>> d['sub.wildcard.example.com']
'example-subdotted'
>>> d['example.wildcard.com']
Traceback (most recent call last):
...
KeyError: 'example.wildcard.com'
"""
def __init__(self, *args, **kwargs):
self.tree = dict(*args, **kwargs)
Expand Down Expand Up @@ -79,6 +83,8 @@ def __getitem__(self, key):
tree = tree[item]
elif '*' in tree:
tree = tree['*']
else:
raise KeyError(key)
if _value in tree:
return tree[_value]
else:
Expand Down
2 changes: 1 addition & 1 deletion mxsniff/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__all__ = ['__version__', '__version_info__']

__version__ = '0.3.4'
__version__ = '0.3.5'
__version_info__ = tuple([int(num) if num.isdigit() else num for num in __version__.replace('-', '.', 1).split('.')])
5 changes: 5 additions & 0 deletions mxsniff/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@
'carrierzone': {'mx': [
'*.carrierzone.com',
]},
'cogent': {'mx': [
'*.mail.cogentco.com',
],
'title': "Cogent Communications"
},
'cologlobal': {'mx': [
'*.cologlobal.com',
]},
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[pytest]
addopts = --doctest-modules
11 changes: 9 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
if mo:
version = mo.group(1)
else:
raise RuntimeError("Unable to find version string in mxsniff/_version.py.")
raise RuntimeError("Unable to find version string in mxsniff/_version.py")


setup(name='mxsniff',
Expand All @@ -29,11 +29,18 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Intended Audience :: Developers',
'Development Status :: 3 - Alpha',
'Intended Audience :: System Administrators',
'Development Status :: 4 - Beta',
'Environment :: Console',
'Topic :: Communications :: Email',
'Topic :: Internet',
'Topic :: Software Development :: Libraries',
'Topic :: Utilities',
],
author='Kiran Jonnalagadda',
author_email='[email protected]',
Expand Down

0 comments on commit 84efc5c

Please sign in to comment.