andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Fix: Allow enki[.py] to import from the local copy of enki if it exists, or ... #173

Closed bjones1 closed 10 years ago

bjones1 commented 10 years ago
   from the Python library if not.
 Fixes #162.
bjones1 commented 10 years ago

...or perhaps a better solution would be to stick with setuptools to create a .exe for Windows and avoid this mess...

andreikop commented 10 years ago

Relative import from ..enki.main ... didn't work for me, because bin/enki and the rest are not in one package. I also modified code to do not remove first entry from sys.path blindly but search for "". Could you please check if current master works for you?

bjones1 commented 10 years ago

That fails for me:

C:\Users\bjones\Documents\enki_all>enki.py Traceback (most recent call last): File "C:\Users\bjones\Documents\enki_all\enki.py", line 37, in sys.exit(main()) NameError: name 'main' is not defined

Perhaps a better workaround: go back to a bare-bones enki, remove enki.py, and have setup install the following enki.bat python -c "import enki.main; enki.main.main();"

Then, typing enki at the Windows command line will run enki.bat, which will run enki. To run the development version, python bin/enki works on Windows. Because enki.py is gone, PyInstaller will work without deleting it. And, there just one script (enki, instead of that plus enki.py) to maintain.

I can create a pull request if you're interested.

andreikop commented 10 years ago

On windows python path contains C:\Python27\Scripts - a location, where enki.py is stored. We may remove this entry, but it seems like hacking path is a bad idea. I'm going to rollback recent changes from this issue and #162 and release current version as v14.03. Than rename enki package to enkilib, and merge 2 your pull requests. It will be next (after v14.03) version.

bjones1 commented 10 years ago

Hmmm. In the end, I'd like a solution so that after installing (python setup.py install), typing "enki" at either the Unix or the Windows command line would run Enki. Let me wait until after your changes above to see what things look like. Would you mind updating this issue when that's done, so I can follow up?

andreikop commented 10 years ago

I reopened #162. I think you receive notifications from it

bjones1 commented 10 years ago

OK, thanks.