I've hacked out some code in perl (I don't know python, but they're very
close, so a port should be trivial) to implement the --install switch to
enable plucker:// protocol system from a windows browser. Here is the
code (it's very short):

----------cut here------------

use File::Temp qw/ mktemp /;

my $url = shift @ARGV or die("Nothing to do.\n");

$url =~ s/plucker:\/\/(https?:\/\/)// or die("URL does not begin with
http(s)://.\n");
$prefix = $1;

$name = &makename($url);

#read preferences here or something

$ext = '.pdb';
$plucker ='C:\Palmtop\Plucker\plucker-build.exe';
$installTool='C:\Palmtop\SonyHa~1\Instapp.exe';
$common = "--zlib-compression --stayonhost --maxdepth=1 --backup
--beamable";
$images = '--noimages';
#$images = '--bpp=8';
$verbosity = '-V 1';

$tmpfile = File::Temp::tmpnam();

system "$plucker --home-url $prefix$url $verbosity $images
--doc-name=$name --doc-file $tmpfile $common";
#check for success

system "$installTool $tmpfile$ext";
#check for success

# clean up like a good boy
unlink $tmpfile.$ext;

exit;

sub makename
{
   my $location = shift;
   my @tokens = split /\//, $location;
   return ($#tokens == -1)? $location : $#_; 
   #last array index or the full location
}

-------crappy code ends------

suggestions?

-- 
Eugene "Gman" Vasserman
[EMAIL PROTECTED]
http://uranium.cataclasm.org/~eugene/
_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev

Reply via email to