michaelcmartin / Ophis

A cross-assembler for the 6502 series of microprocessors.
http://michaelcmartin.github.io/Ophis/
Other
96 stars 26 forks source link

Rewrite the driver script in Python; use os.path.realpath(). #2

Closed catseye closed 12 years ago

catseye commented 12 years ago

After my last comment on the previous pull request, I thought about the problem a bit, and offer this as a possible solution.

I realized that while realpath isn't a standard Unix command, os.path.realpath is a standard part of Python, and it should be OK to rely on Python being installed, given that Ophis is written in Python. So, I rewrote the driver script in Python; actually, I just made it modify sys.path before doing exactly what ophismain.py does.

I suppose this could replace ophismain.py, or this functionality could go into ophismain.py (but I would certainly prefer to type ophis at the shell prompt. And having both a file called ophis and a directory called Ophis in the same directory wouldn't work for users with case-insensitive file systems.)

The driver script still has limitations; for example, it won't work if you move it somewhere else, like /usr/local/bin. But I don't think there is a good solution for that short of turning the project into a full-blown Python package with a setup.py and so forth.