MaddieM4 / pymads

A fork of the pymds authoritative DNS server, designed for asynchronous lookup without domain restrictions.
GNU Lesser General Public License v3.0
4 stars 2 forks source link

Use Persei to add sanity to our string handling ($25) #3

Closed MaddieM4 closed 11 years ago

MaddieM4 commented 11 years ago

The code is currently designed around the unicode clusterfuck that is Python 2, just barely tapped here and there into working in Python 3 in fairly fragile ways. Let's fix that before anything else.

I've factored out the code in ejtp.util.py2and3 into an external library, Persei, for use in Pymads and other projects.

MaddieM4 commented 11 years ago

Bounty is $25.

http://www.freedomsponsors.org/core/issue/260/use-persei-to-add-sanity-to-our-string-handling


(Copied from acceptance criteria)

Add Persei as an external dependency in setup.py and tox.ini. Use persei.RawData and persei.String to make the interfaces between struct-y code and the rest of the codebase sane. You may ignore legacy files pymads.sources.pymadsfile and pymads.filters.pymadsrr.

MaddieM4 commented 11 years ago

At this point, all tests pass, but I'm not super-confident in the infrastructure yet. I'd like to work out some standards for the borders and conversions, and then apply them rigorously.

Stored things

Transmission

Working this out has also made me realize some inconsistencies between packets and records (rtype and rclass are stored as str, qtype and qclass as int) that are not worth fixing as part of this already-invasive branch. I also have some ideas for reducing the argument length on both. That'll all be one issue, I just have to make it.

MaddieM4 commented 11 years ago

All the Storage section is done according to the above spec. Just need to do a few minor tweaks, and the Transmission section will be fulfilled as well.

MaddieM4 commented 11 years ago

Actually, the relevant unpack functions already handle the conversion, so this is all good to go.