Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring XPath search request #161

Merged
merged 2 commits into from
Feb 5, 2015
Merged

Conversation

traut
Copy link
Contributor

@traut traut commented Jan 26, 2015

Debugging my code, that heavily uses libtaxii, I discovered that libtaxii throws IndexError when the entity that needs to be inside XML is not there. I refactored most of etree_xml.xpath calls to use get_required, get_optional, or get_optional_text from libtaxii/commons.py. Method get_required will raise ValueError if the required entity is not found

@traut
Copy link
Contributor Author

traut commented Feb 5, 2015

I feel I owe some explanation here. Please ignore commit 9b4784a. Commit e6ee837 makes sure that "subscription_id" is treated as optional parameter in PollRequest and refactors how XPath searches are executed

@gtback
Copy link
Contributor

gtback commented Feb 5, 2015

Sorry for not responding earlier, @traut; this is a large change. I hope to have some time to look at it in depth soon.

@gtback
Copy link
Contributor

gtback commented Feb 5, 2015

@MarkDavidson and I took a look at this, and everything looks good. Any pull request which reduces the number of lines of code gets a 👍 from me.

gtback added a commit that referenced this pull request Feb 5, 2015
Refactoring XPath search request
@gtback gtback merged commit bd19759 into TAXIIProject:master Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants