On approximately 1/26/2010 7:35 PM, came the following characters from the keyboard of David Lyon:
Glen wrote:

So let's say that the .zip file was dropped onto the Desktop or start
menu.  It would have an icon, then.
It would have an icon. But nothing to identify it as a python
application.

One problem is that in many places, users are trained specifically
under windows to *never* run anything in a zip file. As it might
contain a virus and "bring down the whole company network".

That is not a culture that a lot of people want to "undo"

But having a __main__.py file in a zip file is hardly a clear
and obvious way (to outside people) that it is a python
application.
So let's further say that the .zip file was named .py, instead, but was
a .zip internally.

So this cures the icon too, maybe you realized that.


That would seem to go a long ways toward making the facility user
friendly, at least on Windows, which is where your complaint about icons
was based, and the only change to Python would be to recognize that if a
.py contains a .zip signature, then process it the same way as this
mysterious, not mentioned in the What's New .zip execution facility.
That is perfectly true to say that.

It is *very* clever.

So it begs the question then, why not use that as a form of application
packaging?

The only one downside (from an opinion perspective) is having an
external distribution format, like .egg, does make it easier to
see that the application is not yet installed.

A ZIP named .py doesn't need to be "installed" it can just run in place. And as a couple other subthreads noted, this is already functional in Python 2.6/3.1 today.

Of course, if you want to create a ZIP named .py package that is an application installer, you could do that, too. It might be handy for the case where not everything in the application can be a .py, .pyc, or .pyo... shared libraries cannot be run from the ZIP files as a documented limitation, it seems... so if those are needed, then an installer is needed too. But it does seem that a ZIP name .py installer package could carry other payloads in the ZIP file, and those payloads could be extracted a places in the right places.


Double click them and they get filed in the right place
What platform files things in the right place when you double click them?
Windows and Linux do. When you double click an application installer. They
will go away and start the appropriate application installer. I am
refering to files like .msi's or .rpm's respectively.

You are now describing something different... something that you click on, that causes _other_ things to get filed in the right place. But one has to first create the platform-specific thing to click on, in addition to the code you want to run. Unless, of course, it can be a Python-specific-platform-independent thing. Here the Windows technique of associations, also mentioned in another subthread, do make it easier to actually _click_ on the thing and have the right thing happen, whereas Unix/Linux must have the #! line, and that could vary between different distributions. The command "python application_installer.py" could be cross-platform, though.


But overall, I think this discussion is going in the right direction.

I hope Tarek can pick up on it and fnd a way to work it into distutils if
he has time as it does need to have a home to live.

Without reference to distutils, it seems the pieces are:

1) a way to decide what to include in the package
2) code that knows where to put what is included, on one or more platforms
3) the process to create the ZIP file that includes 1 & 2, and call it an appropriate name.py

3 looks easy, once 1 & 2 are figured out. distutils might provide the foundation for 1. 2 sounds like something a distutils application might create. I'm not sure that distutils is in the business of building installer programs, my understanding is that it is in the business of providing a standard way of recording and interpreting bills of materials and maybe dependencies, but that is based only on reading discussions here, not reading documentation. I haven't had a chance to read all the module documentation since coming to python.

--
Glenn -- http://nevcal.com/
===========================
A protocol is complete when there is nothing left to remove.
-- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to