Skip to content

Commit 136877f

Browse files
authored
Merge pull request #48 from Domain-Connect/bugfix/issue_46
Bugfix/issue 46
2 parents f33308d + 347ef14 commit 136877f

9 files changed

+99
-26
lines changed

.travis.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
language: python
22
python:
3-
- '3.6'
3+
- "2.7"
4+
- "3.6"
5+
- "3.7"
6+
- "3.8"
7+
- "3.9"
48
install:
5-
- pip install -r requirements.txt
6-
- pip install pytest-cov
7-
- pip install unittest2
9+
- pip install -r requirements-test.txt
810
script: py.test --cov=dyndns --cov-config=.coveragerc
911
deploy:
1012
provider: pypi
1113
user: "__token__"
1214
password:
1315
secure: WbgltkoM1BZQJeTJpm7J/Drvh8vm/L4QPm7+aOIP4Xx2Sw71ClAvPYH5I2Q7Vi6hJ2/5W5jCuxuUaqPYAYWYQLpGp5QwyN7FQVlBbcW3N4aCWDKJKrgn20W0caBIKPVTTh/ZuYEbO52nuccZKOqtiLe3UpbSbSNQO5iDI3aNRhggchZUQ/rIVjESYHOmtyW4dAvfHaoCCOirnP2FNuGyD4f9vlz5kXCLMlVXzma+KMzIwNxL6WJrrzUboPbd47MIDswHHrbGGGB6DzUJP2Bz7d2WRDXQahd+spnr7TDH03K3zu23dv1hYluAGx7AUukYLpeFExRkUohpDF+oqqVHfkft13GRKi2hOHLAvqru27T+lAcfwA4E/KnOy2+7bzCW8lyTegkspBVgEb2dOBH/mxGoV2h01bBBO8Ev7QEt+Xnf+EfCgNnKWBZi4LqRCOU+4P8taSIJt5h0JqpxbXCfEIJjCG+hUUkmEd6suVOxFzA90gWLVUQS3T/4yMRxpCwykrJ66a1IWTgVP6nFvTRJkJ+KuRjsr7rI3hR8L07fDmyjfWNnyaQ/3sBWCXkH2BEJnGU6Z099NmqQ/vlIiVAmRUGG5rASf5cAxh4DkVbmqu98nxC/ZqEKAb3kjZX+lPy20j1L0+1UUOch0RMgtIlF9ipZtKCeROnml6xsvJ9V3Oc=
1416
on:
15-
tags: true
17+
tags: true
18+
skip_existing: true

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
9+
## [0.0.9] - 2021-04-14
10+
11+
### Changed
812
- BUGFIX: unhandled exception if not domainconnect record or no settings (Issue #32)
13+
- SETUP: upgraded dependencies and split of requirements.txt
14+
- BUGFIX: support when no webbrowser module (OpenWRT)
915

1016
## [0.0.8] - 2020-06-30
1117

dyndns/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__="0.0.9"

dyndns/command_line.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
from dyndns import domain_update
88
from dyndns import domain_status
99
from dyndns import domain_remove
10+
from . import __version__
1011

1112

1213
def main():
1314
parser = argparse.ArgumentParser(description="Config domain for DynDNS")
1415

1516
parser.add_argument('action', choices=['setup', 'update', 'status', 'remove'], help="action to be performed on "
1617
"domain(s)")
18+
parser.add_argument('--version', action='version', version='%(prog)s {version}'.format(version=__version__))
1719
parser.add_argument('--config', type=str, default='settings.txt', help="config file path")
1820
parser.add_argument('--backup_file', default=None, help="backup file path for remove domain")
1921
parser.add_argument('--ignore-previous-ip', action='store_true', dest='ignore_previous_ip',
@@ -35,6 +37,8 @@ def main():
3537
ignore_ipv4 = "ipv4" not in args.protocols
3638
ignore_ipv6 = "ipv6" not in args.protocols
3739

40+
print('*** {} {} ***\n'.format(parser.prog, __version__))
41+
3842
# validate domain
3943
if domain and not validators.domain(domain) is True:
4044
print("Domain is not valid.")

dyndns/domain_setup.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import json
22
import os.path
3-
import webbrowser
3+
try:
4+
import webbrowser
5+
except ModuleNotFoundError:
6+
pass
7+
import sys
48
from builtins import input
59

610
from domainconnect import DomainConnect, DomainConnectAsyncCredentials, TemplateNotSupportedException, \
@@ -43,8 +47,8 @@ def main(domain, protocols, settings='settings.txt'):
4347
params=params,
4448
redirect_uri='https://dynamicdns.domainconnect.org/ddnscode'
4549
)
46-
47-
webbrowser.open(context.asyncConsentUrl, autoraise=True)
50+
if "webbrowser" in sys.modules:
51+
webbrowser.open(context.asyncConsentUrl, autoraise=True)
4852
code = input("Please open\n{}\nand provide us the access code:".format(context.asyncConsentUrl))
4953

5054
tries = 1

dyndns/tests/test_dyndns.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def setUp(self):
1616
self.host = 'testing.'
1717
self.domain = 'connect.domains'
1818
self.expected_settings_keys = [
19-
'access_token_expires_in', 'access_token', 'url_api', 'iat', 'provider_name', 'refresh_token'
19+
'access_token_expires_in', 'access_token', 'url_api', 'protocols', 'iat', 'provider_name', 'refresh_token'
2020
]
2121

2222
def tearDown(self):
@@ -66,7 +66,7 @@ def test_update_domain(self):
6666
domain_setup.main(self.host + self.domain, ['ipv4'])
6767
assert (os.path.exists('settings.txt')), 'Settings file missing'
6868
result = domain_update.main(self.host + self.domain)
69-
assert (result in ['A record up to date.', 'DNS record successfully updated.']), result
69+
assert (result in ['All records up to date. No update required.', 'DNS record successfully updated.']), result
7070

7171

7272
if __name__ == '__main__':

requirements-test.txt

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
atomicwrites==1.4.0
2+
attrs==20.3.0
3+
backports.functools-lru-cache==1.6.4
4+
certifi==2020.12.5
5+
cffi==1.14.5
6+
chardet==4.0.0
7+
colorama==0.4.4
8+
configparser==4.0.2
9+
contextlib2==0.6.0.post1
10+
coverage==5.5
11+
cryptography==3.3.2
12+
decorator==4.4.2
13+
dnspython==1.16.0
14+
domain-connect==0.0.9
15+
enum34==1.1.10
16+
funcsigs==1.0.2
17+
future==0.18.2
18+
idna==2.10
19+
importlib-metadata==2.1.1
20+
ipaddress==1.0.23
21+
linecache2==1.0.0
22+
more-itertools==5.0.0
23+
packaging==20.9
24+
pathlib2==2.3.5
25+
pluggy==0.13.1
26+
publicsuffix==1.1.1
27+
publicsuffixlist==0.7.7
28+
py==1.10.0
29+
pycparser==2.20
30+
pyparsing==2.4.7
31+
pytest==4.6.11
32+
pytest-cov==2.11.1
33+
requests==2.25.1
34+
scandir==1.10.0
35+
six==1.15.0
36+
traceback2==1.4.0
37+
unittest2==1.1.0
38+
urllib3==1.26.4
39+
validators==0.14.2
40+
wcwidth==0.2.5
41+
zipp==1.2.0

requirements.txt

+18-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
coverage==4.5.1
2-
coveralls==1.5.0
3-
domain-connect==0.0.7
4-
pytest==3.7.4
5-
unittest2==1.1.0
6-
validators~=0.14.0
7-
mock==2.0.0
8-
requests==2.21.0
9-
ipaddress==1.0.23; python_version < '3.3'
10-
11-
argparse~=1.4.0
12-
dnspython~=1.16.0
13-
setuptools~=40.8.0
1+
certifi==2020.12.5
2+
cffi==1.14.5
3+
chardet==4.0.0
4+
cryptography==3.3.2
5+
decorator==4.4.2
6+
dnspython==1.16.0
7+
domain-connect==0.0.9
8+
enum34==1.1.10
9+
future==0.18.2
10+
idna==2.10
11+
ipaddress==1.0.23
12+
publicsuffix==1.1.1
13+
publicsuffixlist==0.7.7
14+
pycparser==2.20
15+
requests==2.25.1
16+
six==1.15.0
17+
urllib3==1.26.4
18+
validators==0.14.2

setup.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/usr/bin/env python
22
from setuptools import setup
3+
import dyndns
34

45
with open("README.md", "r") as fh:
56
long_description = fh.read()
67

8+
test_deps = [
9+
'unittest2 >= 1.1.0',
10+
]
11+
712
setup(
813
name = 'domain-connect-dyndns',
9-
version = '0.0.8',
14+
version=dyndns.__version__,
1015
description = 'Python client library for Dynamic DNS using Domain Connect',
1116
license = 'MIT',
1217
long_description=long_description,
@@ -27,10 +32,14 @@
2732
'validators >= 0.12.6',
2833
'requests >= 2.21.0',
2934
'dnspython >= 1.15.0',
30-
'domain-connect >= 0.0.7',
35+
'domain-connect >= 0.0.9',
3136
'ipaddress >= 1.0.23;python_version<"3.3"',
3237
],
3338
entry_points = {
3439
'console_scripts': ['domain-connect-dyndns=dyndns.command_line:main'],
35-
}
40+
},
41+
tests_require=test_deps,
42+
extras_require={
43+
'test': test_deps,
44+
},
3645
)

0 commit comments

Comments
 (0)