[Pythonmac-SIG] Suggestion for PythonMac-tutorial: droplets?

Steven D. Majewski sdm7g@virginia.edu
Wed, 29 Jul 1998 18:43:22 -0400 (EDT)


On Thu, 30 Jul 1998, Jack Jansen wrote:

> Recently, Wolfgang Keller <wolfgang@amadeus.m.eunet.de> said:
> > Hello,
> > 
> > there doesn't seem to be any example available of how to write a droplet in
> > Python.
> 
> If I understand the term "droplet" correct, an applet on which you can 
> drop files, then every Python applet is a droplet. By default every
> applet will accept files of any type, and they'll all end up in
> sys.argv. If you want to change the former you can supply your own
> resource file with a different BNDL resource, if you want to change
> the latter, and do your own startup AppleEvent processing (for
> instance because you want to catch a GURL startup event) you drop your 
> applet on EditPythonPrefs and set the "no argc/argv" and preferrably
> "no starup option dialog" options.
> 
> Do people feel that this behaviour deserves special mention in the
> documentation? 

Yes -- because of the Mac's non-cli oriented nature, droplets are 
especially useful. 

Back when I was bugging you about changing the default BNDLs, I 
posted some examples of trying to make a generic framework for
this sort of thing, which included recursive expansion of 
dropped folders/disks/directories, filtering on file types or
names, and progress bars and prompts. One example was a file-typer
utility which took it's destination type from it's sys.argv[0] name: 
named "-->CARO" , it makes Acrobat Reader the Creator, renamed 
"-->vgrd" it makes them into PostScript textfiles, and renamed
"-->MOSS" it makes Netscape the owner. ( Perhaps an improved
version would use file extensions and/or Internet Config to do 
multiple conversions  .PDF-->CARO, .HTML->MOSS, .PS->vgrd so 
you could update a whole folder or diskful of files with one drop.)


If you're interested in an example, I'll dig back and see if this
has been completely updated for 1.5.1 . 


---|  Steven D. Majewski   (804-982-0831)  <sdm7g@Virginia.EDU>  |---
---|  Department of Molecular Physiology and Biological Physics  |---
---|  University of Virginia             Health Sciences Center  |---
---|  P.O. Box 10011            Charlottesville, VA  22906-0011  |---

"I'm not as big a fool as I used to be, I'm a smaller fool." - Jack Kerouac
Some of the Dharma  <http://members.aol.com/kerouacsis/SomeDharma.html>