python-pskc branch master updated. 0.4-23-gd864bc8
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
python-pskc branch master updated. 0.4-23-gd864bc8
- From: Commits of the python-pskc project <python-pskc-commits [at] lists.arthurdejong.org>
- To: python-pskc-commits [at] lists.arthurdejong.org
- Reply-to: python-pskc-users [at] lists.arthurdejong.org
- Subject: python-pskc branch master updated. 0.4-23-gd864bc8
- Date: Tue, 20 Dec 2016 12:33:05 +0100 (CET)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "python-pskc".
The branch, master has been updated
via d864bc8da25767975271b50579fe5370eee1eda6 (commit)
via c6316280962af0e544ba08c3b11a6a2c0c25410a (commit)
via 18d82dcb349738b19406e0544b732cada3f66e94 (commit)
via 71058e23db69adeb8755cde8555fc3137c8f167b (commit)
via f0a0a3b15a7fa44d568898122710d2e1d889dabb (commit)
via 3bf47374ddc9ba4248ef551ba889b7acf0d21725 (commit)
from 02b30a9ccb717e4efa5d1366b7e55a8d8e66c2c6 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://arthurdejong.org/git/python-pskc/commit/?id=d864bc8da25767975271b50579fe5370eee1eda6
commit d864bc8da25767975271b50579fe5370eee1eda6
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Dec 19 11:43:49 2016 +0100
Ensure XML file ends with a newline
diff --git a/pskc/serialiser.py b/pskc/serialiser.py
index 4df8046..dd498d0 100644
--- a/pskc/serialiser.py
+++ b/pskc/serialiser.py
@@ -30,7 +30,7 @@ class PSKCSerialiser(object):
@classmethod
def serialise_file(cls, pskc, output):
- xml = tostring(cls.serialise_document(pskc))
+ xml = tostring(cls.serialise_document(pskc)) + '\n'.encode('UTF-8')
try:
output.write(xml)
except TypeError: # pragma: no cover (Python 3 specific)
http://arthurdejong.org/git/python-pskc/commit/?id=c6316280962af0e544ba08c3b11a6a2c0c25410a
commit c6316280962af0e544ba08c3b11a6a2c0c25410a
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Dec 19 11:21:24 2016 +0100
Adapt coverage pragma annotations
This fixes the pragma directives to be be correct independently of
whether lxml is installed or not.
diff --git a/pskc/xml.py b/pskc/xml.py
index c4c8899..1ecf2ca 100644
--- a/pskc/xml.py
+++ b/pskc/xml.py
@@ -61,7 +61,7 @@ def remove_namespaces(tree):
"""Remove namespaces from all elements in the tree."""
import re
for elem in tree.getiterator():
- if isinstance(elem.tag, ''.__class__):
+ if isinstance(elem.tag, ''.__class__): # pragma: no branch
elem.tag = re.sub(r'^\{[^}]*\}', '', elem.tag)
@@ -176,7 +176,7 @@ def tostring(element):
"""Return a serialised XML document for the element tree."""
from xml.dom import minidom
# if we are using lxml.etree move namespaces to toplevel element
- if hasattr(element, 'nsmap'): # pragma: no branch (only on lxml)
+ if hasattr(element, 'nsmap'): # pragma: no cover (only on lxml)
# get all used namespaces
nsmap = {}
for e in element.iter():
http://arthurdejong.org/git/python-pskc/commit/?id=18d82dcb349738b19406e0544b732cada3f66e94
commit 18d82dcb349738b19406e0544b732cada3f66e94
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Dec 19 11:18:23 2016 +0100
Add Tox configuration
This sets up Tox with various versions of Python and for each version a
run with and without lxml.
diff --git a/.gitignore b/.gitignore
index 919b186..b5a317f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,6 +7,7 @@ __pycache__
/*.egg
/*.egg-info
/.coverage
+/.tox
/build
/coverage
/dist
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..a8a8204
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,31 @@
+[tox]
+envlist = {py27,py34,py35,py36,py27-lxml,py34-lxml,py35-lxml,py36-lxml}
+
+[testenv]
+deps = nose
+ coverage
+ pycrypto
+ python-dateutil
+commands = nosetests
+setenv=
+ PYTHONWARNINGS=all
+
+[testenv:py27-lxml]
+basepython = python2.7
+deps = {[testenv]deps}
+ lxml
+
+[testenv:py34-lxml]
+basepython = python3.4
+deps = {[testenv]deps}
+ lxml
+
+[testenv:py35-lxml]
+basepython = python3.5
+deps = {[testenv]deps}
+ lxml
+
+[testenv:py36-lxml]
+basepython = python3.6
+deps = {[testenv]deps}
+ lxml
http://arthurdejong.org/git/python-pskc/commit/?id=71058e23db69adeb8755cde8555fc3137c8f167b
commit 71058e23db69adeb8755cde8555fc3137c8f167b
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Dec 19 11:14:04 2016 +0100
Close read files in tests
This ensures that the files that are read in the test suite are properly
closed to avoid leaking open file descriptors.
diff --git a/tests/test_write.doctest b/tests/test_write.doctest
index 096194f..d10e00d 100644
--- a/tests/test_write.doctest
+++ b/tests/test_write.doctest
@@ -100,7 +100,8 @@ argument).
>>> f = tempfile.NamedTemporaryFile()
>>> pskc.write(f.name)
->>> x = sys.stdout.write(open(f.name, 'r').read()) #doctest: +REPORT_UDIFF
+>>> with open(f.name, 'r') as r:
+... x = sys.stdout.write(r.read()) #doctest: +REPORT_UDIFF
<?xml version="1.0" encoding="UTF-8"?>
<pskc:KeyContainer Version="1.0"
xmlns:pskc="urn:ietf:params:xml:ns:keyprov:pskc">
<pskc:KeyPackage>
@@ -270,7 +271,8 @@ Set up an encrypted PSKC file and generate a pre-shared key
for it.
... key_name='Pre-shared KEY', fields = ['secret', 'counter'])
>>> f = tempfile.NamedTemporaryFile()
>>> pskc.write(f.name)
->>> x = sys.stdout.write(open(f.name, 'r').read()) #doctest: +ELLIPSIS
+REPORT_UDIFF
+>>> with open(f.name, 'r') as r:
+... x = sys.stdout.write(r.read()) #doctest: +ELLIPSIS +REPORT_UDIFF
<?xml version="1.0" encoding="UTF-8"?>
<pskc:KeyContainer Version="1.0" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:pskc="urn:ietf:params:xml:ns:keyprov:pskc"
xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<pskc:EncryptionKey>
http://arthurdejong.org/git/python-pskc/commit/?id=f0a0a3b15a7fa44d568898122710d2e1d889dabb
commit f0a0a3b15a7fa44d568898122710d2e1d889dabb
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Sun Dec 18 21:57:56 2016 +0100
Support missing or lowercase version attribute
diff --git a/pskc/parser.py b/pskc/parser.py
index a5dac2a..03a8a8e 100644
--- a/pskc/parser.py
+++ b/pskc/parser.py
@@ -45,8 +45,8 @@ class PSKCParser(object):
if container.tag != 'KeyContainer':
raise ParseError('Missing KeyContainer')
# the version of the PSKC schema
- pskc.version = container.get('Version')
- if pskc.version != '1.0':
+ pskc.version = container.get('Version') or container.get('version')
+ if pskc.version and pskc.version != '1.0':
raise ParseError('Unsupported version %r' % pskc.version)
# unique identifier for the container
pskc.id = container.get('Id')
http://arthurdejong.org/git/python-pskc/commit/?id=3bf47374ddc9ba4248ef551ba889b7acf0d21725
commit 3bf47374ddc9ba4248ef551ba889b7acf0d21725
Author: Arthur de Jong <arthur@arthurdejong.org>
Date: Mon Sep 26 21:41:09 2016 +0200
Fix copy-pasto in documentation
This accidentally slipped in as part of beafc6b.
diff --git a/docs/usage.rst b/docs/usage.rst
index 48f71de..47ea04b 100644
--- a/docs/usage.rst
+++ b/docs/usage.rst
@@ -309,13 +309,6 @@ The Device class
:class:`~pskc.device.Device` class with which the new key is
initialised.
-
- """Create a new key instance for the device.
-
- The new key is initialised with properties from the provided keyword
- arguments if any."""
-
-
.. attribute:: manufacturer
The name of the manufacturer of the device to which the key is
-----------------------------------------------------------------------
Summary of changes:
.gitignore | 1 +
docs/usage.rst | 7 -------
pskc/parser.py | 4 ++--
pskc/serialiser.py | 2 +-
pskc/xml.py | 4 ++--
tests/test_write.doctest | 6 ++++--
tox.ini | 31 +++++++++++++++++++++++++++++++
7 files changed, 41 insertions(+), 14 deletions(-)
create mode 100644 tox.ini
hooks/post-receive
--
python-pskc
--
To unsubscribe send an email to
python-pskc-commits-unsubscribe@lists.arthurdejong.org or see
https://lists.arthurdejong.org/python-pskc-commits/
- python-pskc branch master updated. 0.4-23-gd864bc8,
Commits of the python-pskc project