Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pylti/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
PyLTI is module that implements IMS LTI in python
The API uses decorators to wrap function with LTI functionality.
"""
VERSION = "0.1.1"
VERSION = "0.1.3" # pragma: no cover
9 changes: 5 additions & 4 deletions pylti/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

import oauth2
import oauth.oauth as oauth
from lxml import etree

from xml.etree import ElementTree as etree
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I take it that the functionality that you were getting from lxml, you can also get from xml.etree, thereby eliminate the need to require the lxml library?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct. I needed to add XML declaration below, but it produces same functionality. And without need for libxml.
Libxml is native XML library and if we are doing a lot of XML processing it would be worth while, but we can get


log = logging.getLogger('pylti.common') # pylint: disable=invalid-name

Expand Down Expand Up @@ -282,6 +281,8 @@ def generate_request_xml(message_identifier_id, operation,
language.text = 'en'
text_string = etree.SubElement(result_score, 'textString')
text_string.text = score.__str__()
ret = "<?xml version='1.0' encoding='utf-8'?>\n{}".format(
etree.tostring(root, encoding='utf-8'))
log.debug("XML Response: \n{}".format(
etree.tostring(root, xml_declaration=True, encoding='utf-8')))
return etree.tostring(root, xml_declaration=True, encoding='utf-8')
ret))
return ret
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ pytest-cache==1.0
pytest-cov==1.8.0
pytest-flakes==0.2
pytest-pep8==1.0.6

httplib2==0.9
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def run_tests(self):
"oauthlib>=0.6.3", "semantic_version>=2.3.1"],
cmdclass={"test": PyTest},
install_requires=["oauth>=1.0.1", "oauth2>=1.5.211",
"lxml>=3.4.0", ],
"httplib2>=0.9" ],
include_package_data=True,
zip_safe=False)
except ImportError:
Expand Down