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...
Allow local timezones with non-00 minutes offsets to work.
Fixed the backup hostname grabber leaving a trailing newline.
Submissions using the sal package
sal.pref will now behave as expected in regards to the default arg (as in, like the dict.get default arg.
Factors out Apple model lookup code to just the bare essentials.
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 intoplistlib.loads
,base64.b64encode
, andbz2.compress
), and python 3str
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...
sal
packagesal.pref
will now behave as expected in regards to thedefault
arg (as in, like thedict.get
default arg.