Changeset 4068ed9


Ignore:
Timestamp:
Jul 6, 2010, 12:08:40 AM (14 years ago)
Author:
Jessica B. Hamrick <jhamrick@…>
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)
Message:

Merge branch 'master' into debian

Conflicts:

.gitignore

Files:
29 added
8 edited

Legend:

Unmodified
Added
Removed
  • README

    r03e2535 rb58aada  
    8787  package or something
    8888
    89 - add regex support to the client scripts, so you can do something
    90   like `gbr sipbmp3 *.mp3` and have it send separate jobs to the queue
    91 
    9289- add client scripts for the remctl package, something maybe like
    9390  `gbvol [set|get] number`.  Or maybe just leave it with using remctl.
     
    9592- fix the web interface
    9693
    97 - fix the youtube feature.  Additionally, make it possible to play
    98   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  
    2020my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
    2121if (! -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";
    2323    exit 1;
    2424}
     
    3838
    3939print "Queue listing for queue '$queue' on '$host'\n\n";
    40 print "Job ID\t\tOwner\t\tFile\n";
     40print "Job ID\t\tOwner\t\tTitle\n";
    4141print "-----------------------------------------------------------------\n";
    4242
  • client/bin/gbr

    rc5a98db r0d02eca  
    66use warnings;
    77
    8 my $usage = "Usage: gbr QUEUE FILE\n";
     8use Net::CUPS;
     9use Net::CUPS::Destination;
     10use Image::ExifTool qw(ImageInfo);
     11
     12my $usage = "Usage: gbr QUEUE FILES\n";
    913
    1014my $q = $ARGV[0];
    11 my $file = $ARGV[1];
     15my @files = @ARGV[1 .. $#ARGV];
    1216
    13 if (!$q or !$file) {
     17if (!$q or !@files) {
    1418    print $usage;
    1519    exit 1
     
    1822my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
    1923if (! -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";
    2125    exit 1;
    2226}
     
    3135}
    3236
    33 $ENV{CUPS_SERVER}="$host";
     37my $cups = Net::CUPS->new();
     38$cups->setServer("$host");
     39my $printer = $cups->getDestination("$queue");
     40my ($jobid, $title);
    3441
    35 if ($file =~ m|http://www\.youtube\.com/watch\?v=|) {
    36     open(LP, "|-", "lp", "-d$queue");
    37     print LP "$file";
    38     close LP;
     42foreach 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    }
    3970}
    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  
    44.SH SYNOPSIS
    55.B gbr
    6 \fIQUEUE\fR \fIFILE\fR
     6\fIQUEUE\fR \fIFILES\fR
    77.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
     8Prints files to a Gutenbach queue, given the queue name and the path
     9to the files.  gbr correctly handles pathname expansion, so (for
     10example), if you wish to play all .mp3 files in a directory, the
     11command `gbr $queue *.mp3` will send each .mp3 as a separate job.  The
     12path may also be a URL to a
    1013.B YouTube
    1114video (e.g. http://www.youtube.com/watch?v=foo).  The Gutenbach queue
  • client/bin/gbrm

    rc5a98db r0d02eca  
    55use strict;
    66use warnings;
     7
     8use Net::CUPS;
     9use Net::CUPS::Destination;
    710
    811my $usage = "Usage: gbq QUEUE ID\n";
     
    1821my $configpath = "$ENV{'HOME'}/.gutenbach/$q";
    1922if (! -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";
    2124    exit 1;
    2225}
     
    3134}
    3235
    33 my @args;
     36my $cups = Net::CUPS->new();
     37$cups->setServer("$host");
     38my $printer = $cups->getDestination("$queue");
     39my @jobs = $printer->getJobs(0, 0);
    3440
    3541if ($id eq "all") {
    36     @args = ("cancel", "-a", "$queue");
     42    foreach $id(@jobs) {
     43        cancel_job($id, $printer);
     44    }
     45}
     46elsif ($id eq "current") {
     47    $id = $jobs[0];
     48    cancel_job($id, $printer);
     49}
     50elsif ($id eq "last") {
     51    $id = $jobs[-1];
     52    cancel_job($id, $printer);
    3753}
    3854else {
    39     @args = ("cancel", "$id", "$queue");
     55    cancel_job($id, $printer);
    4056}
    41 $ENV{CUPS_SERVER}="$host";
    42 exec (@args) or die "Couldn't execute cancel command";
     57
     58sub 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  
    44.SH SYNOPSIS
    55.B gbrm
    6 \fIQUEUE\fR [all|\fIID\fR]
     6\fIQUEUE\fR [all|current|\fIID\fR]
    77.SH DESCRIPTION
    88Removes a single job from a Gutenbach queue, given the job id, which
     
    1111command.  If
    1212.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
     13is used in place of an id, then all jobs are removed from the queue.  If
     14.B current
     15is used in place of an id, then the current (top) job is removed from
     16the queue.  If
     17.B last
     18is used in place of an id, then the last job is removed from the
     19queue.  The queue must have previously been added with
    1520.B gutenbach-client-config
    1621so that gbrm knows which host to use.
  • server/lib/gutenbach

    rc5a98db rb58aada  
    121121$SIG{HUP} = \&clear_status;
    122122$SIG{TERM} = \&clear_status;
     123$SIG{INT} = \&clear_status;
    123124
    124125# Read the metadata information from the file.
  • .gitignore

    rb58aada r1d7e681  
    11*~
     2debian/files
     3debian/*.debhelper
     4debian/*.substvars
     5debian/*.debhelper.log
     6debian/gutenbach/
     7debian/gutenbach-client/
     8debian/gutenbach-queue/
     9debian/gutenbach-remctl/
     10debian/gutenbach-server/
     11debian/stamp-makefile-build
     12debian/tmp/
    213client/bin/*.1.gz
    3 debian/
Note: See TracChangeset for help on using the changeset viewer.