( )⚙ D7415 procutil: move datapath logic to procutil()

This is an archive of the discontinued Mercurial Phabricator instance.

procutil: move datapath logic to procutil()
AbandonedPublic

Authored by indygreg on Nov 14 2019, 10:58 PM.

Details

Reviewers
None
Group Reviewers
hg-reviewers
Summary

And refactor it as a function.

procutil.py is the more appropriate location for this code, as
procutil is responsible for managing aspects of the executable
environment.

The impetus for this change is introducing an abstraction for
resource reading. I'd like that code to live in procutil.py
so we don't make util.py any larger. The code requires datapath.
And since util imports procutil, we need datapath in procutil
to avoid a cycle.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

indygreg created this revision.Nov 14 2019, 10:58 PM
indygreg planned changes to this revision.

This is an old series I had authored a few months back as part of preliminary PyOxidizer porting. It demonstrates an alternate approach to loading files with the resources API. Essentially, I was trying to abstract the resources API so that in the future once we are Python 3.7+ native we could use importlib.resources directly and perform all resources I/O using a resources abstraction.

This series is in desperate need of a rebase.

Please take a look @mharbison72 and consider taking ownership of these patches under your own name.

Also see D7433-D7436, which move this code to a new module so the i18n module can depend on this code.

indygreg abandoned this revision.Nov 16 2019, 2:20 PM

This patch is now irrelevant due to D7434.