salopensource / sal-scripts

Apache License 2.0
23 stars 31 forks source link

Py3 #67

Closed sheagcraig closed 4 years ago

sheagcraig commented 4 years ago

Feast your eyes on this, and let me know what you think.

This mostly does the work of converting everything in Sal scripts to use python3, and includes a relocatable python framework with it rather than using one that's already there. So that's one thing to consider; is this ultimately what we want to do?

Most of the PR is updating things to use f-strings, plistlib instead of FoundationPlist, and having the datetime.timezone.utc to work with. I went over everything that does subprocesses and gets output and made sure we got bytes where desired (stuff going into plistlib.loads, base64.b64encode, and bz2.compress), and python 3 str everywhere else.

All of the utils.py module has been moved into a proper python package, which gets pip installed into the python framework's site-packages. Any checkin modules from other projects will want to update their imports, as importing /usr/local/sal/utils.py won't work any more.

Currently just including pyobjc as an additional package. This is open for expansion of course.

There are a few fixes for things too. I'll try to dig them all out from the commits...