Changeset 4068ed9
- Timestamp:
- Jul 6, 2010, 12:08:40 AM (14 years ago)
- Branches:
- debian
- Children:
- 7009a01
- Parents:
- 31d7856 (diff), 0d02eca (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - git-author:
- Jessica B. Hamrick <jhamrick@…> (07/06/10 00:08:40)
- git-committer:
- Jessica B. Hamrick <jhamrick@…> (07/06/10 00:08:40)
- Files:
-
- 29 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
README
r03e2535 rb58aada 87 87 package or something 88 88 89 - add regex support to the client scripts, so you can do something90 like `gbr sipbmp3 *.mp3` and have it send separate jobs to the queue91 92 89 - add client scripts for the remctl package, something maybe like 93 90 `gbvol [set|get] number`. Or maybe just leave it with using remctl. … … 95 92 - fix the web interface 96 93 97 - fix the youtube feature. Additionally, make it possible to play98 movies!94 - Make it possible to play movies; i.e. add video support (the audio 95 support is already there, obviously) -
client/bin/gbq
r30beeab r0d02eca 20 20 my $configpath = "$ENV{'HOME'}/.gutenbach/$q"; 21 21 if (! -e $configpath) { 22 print "Queue '$q' does not exist! \n";22 print "Queue '$q' does not exist! Did you forget to add it with 'gutenbach-client-config'?\n"; 23 23 exit 1; 24 24 } … … 38 38 39 39 print "Queue listing for queue '$queue' on '$host'\n\n"; 40 print "Job ID\t\tOwner\t\t File\n";40 print "Job ID\t\tOwner\t\tTitle\n"; 41 41 print "-----------------------------------------------------------------\n"; 42 42 -
client/bin/gbr
rc5a98db r0d02eca 6 6 use warnings; 7 7 8 my $usage = "Usage: gbr QUEUE FILE\n"; 8 use Net::CUPS; 9 use Net::CUPS::Destination; 10 use Image::ExifTool qw(ImageInfo); 11 12 my $usage = "Usage: gbr QUEUE FILES\n"; 9 13 10 14 my $q = $ARGV[0]; 11 my $file = $ARGV[1];15 my @files = @ARGV[1 .. $#ARGV]; 12 16 13 if (!$q or ! $file) {17 if (!$q or !@files) { 14 18 print $usage; 15 19 exit 1 … … 18 22 my $configpath = "$ENV{'HOME'}/.gutenbach/$q"; 19 23 if (! -e $configpath) { 20 print "Queue '$q' does not exist! \n";24 print "Queue '$q' does not exist! Did you forget to add it with 'gutenbach-client-config'?\n"; 21 25 exit 1; 22 26 } … … 31 35 } 32 36 33 $ENV{CUPS_SERVER}="$host"; 37 my $cups = Net::CUPS->new(); 38 $cups->setServer("$host"); 39 my $printer = $cups->getDestination("$queue"); 40 my ($jobid, $title); 34 41 35 if ($file =~ m|http://www\.youtube\.com/watch\?v=|) { 36 open(LP, "|-", "lp", "-d$queue"); 37 print LP "$file"; 38 close LP; 42 foreach my $file(@files) { 43 if ($file =~ m|http://www\.youtube\.com/watch\?v=|) { 44 open FILE, ">", "/tmp/gutenbach-youtube\n" or die "Couldn't create temporary file"; 45 print FILE $file; 46 $title = $file; 47 $file = "/tmp/gutenbach-youtube"; 48 $printer->addOption("copies", 42); 49 } 50 else { 51 my $fileinfo = ImageInfo($file); 52 my $magic = $fileinfo->{FileType}; 53 54 if ($magic) { 55 $title = $fileinfo->{'Title'}." - ".$fileinfo->{'Artist'}." - ".$fileinfo->{'Album'}; 56 } 57 else { 58 $title = $file; 59 } 60 } 61 62 $jobid = $printer->printFile($file, $title); 63 64 if ($jobid) { 65 print "Sent job '$title' (id $jobid)\n"; 66 } 67 else { 68 print "Error sending job '$title'\n"; 69 } 39 70 } 40 else {41 my @args = ("lp", "-d$queue", "$file");42 exec (@args) or die "Couldn't execute lp command";43 } -
client/bin/gbr.1
rc5a98db r38388ac 4 4 .SH SYNOPSIS 5 5 .B gbr 6 \fIQUEUE\fR \fIFILE \fR6 \fIQUEUE\fR \fIFILES\fR 7 7 .SH DESCRIPTION 8 Prints a file to a Gutenbach queue, given the queue name and the path 9 to the file. The path may also be a URL to a 8 Prints files to a Gutenbach queue, given the queue name and the path 9 to the files. gbr correctly handles pathname expansion, so (for 10 example), if you wish to play all .mp3 files in a directory, the 11 command `gbr $queue *.mp3` will send each .mp3 as a separate job. The 12 path may also be a URL to a 10 13 .B YouTube 11 14 video (e.g. http://www.youtube.com/watch?v=foo). The Gutenbach queue -
client/bin/gbrm
rc5a98db r0d02eca 5 5 use strict; 6 6 use warnings; 7 8 use Net::CUPS; 9 use Net::CUPS::Destination; 7 10 8 11 my $usage = "Usage: gbq QUEUE ID\n"; … … 18 21 my $configpath = "$ENV{'HOME'}/.gutenbach/$q"; 19 22 if (! -e $configpath) { 20 print "Queue '$q' does not exist! \n";23 print "Queue '$q' does not exist! Did you forget to add it with 'gutenbach-client-config'?\n"; 21 24 exit 1; 22 25 } … … 31 34 } 32 35 33 my @args; 36 my $cups = Net::CUPS->new(); 37 $cups->setServer("$host"); 38 my $printer = $cups->getDestination("$queue"); 39 my @jobs = $printer->getJobs(0, 0); 34 40 35 41 if ($id eq "all") { 36 @args = ("cancel", "-a", "$queue"); 42 foreach $id(@jobs) { 43 cancel_job($id, $printer); 44 } 45 } 46 elsif ($id eq "current") { 47 $id = $jobs[0]; 48 cancel_job($id, $printer); 49 } 50 elsif ($id eq "last") { 51 $id = $jobs[-1]; 52 cancel_job($id, $printer); 37 53 } 38 54 else { 39 @args = ("cancel", "$id", "$queue");55 cancel_job($id, $printer); 40 56 } 41 $ENV{CUPS_SERVER}="$host"; 42 exec (@args) or die "Couldn't execute cancel command"; 57 58 sub cancel_job { 59 my ($id, $printer) = @_; 60 my $job_ref = $printer->getJob($id); 61 my $title = $job_ref->{'title'}; 62 $printer->cancelJob($id); 63 64 print "Canceled job '$title' (id $id)\n"; 65 } -
client/bin/gbrm.1
r2c76f34 rd768767 4 4 .SH SYNOPSIS 5 5 .B gbrm 6 \fIQUEUE\fR [all| \fIID\fR]6 \fIQUEUE\fR [all|current|\fIID\fR] 7 7 .SH DESCRIPTION 8 8 Removes a single job from a Gutenbach queue, given the job id, which … … 11 11 command. If 12 12 .B all 13 is used in place of an id, then all jobs are removed from the queue. 14 The queue must have previously been added with 13 is used in place of an id, then all jobs are removed from the queue. If 14 .B current 15 is used in place of an id, then the current (top) job is removed from 16 the queue. If 17 .B last 18 is used in place of an id, then the last job is removed from the 19 queue. The queue must have previously been added with 15 20 .B gutenbach-client-config 16 21 so that gbrm knows which host to use. -
server/lib/gutenbach
rc5a98db rb58aada 121 121 $SIG{HUP} = \&clear_status; 122 122 $SIG{TERM} = \&clear_status; 123 $SIG{INT} = \&clear_status; 123 124 124 125 # Read the metadata information from the file. -
.gitignore
rb58aada r1d7e681 1 1 *~ 2 debian/files 3 debian/*.debhelper 4 debian/*.substvars 5 debian/*.debhelper.log 6 debian/gutenbach/ 7 debian/gutenbach-client/ 8 debian/gutenbach-queue/ 9 debian/gutenbach-remctl/ 10 debian/gutenbach-server/ 11 debian/stamp-makefile-build 12 debian/tmp/ 2 13 client/bin/*.1.gz 3 debian/
Note: See TracChangeset
for help on using the changeset viewer.