From: minima Date: Sat, 7 Jan 2006 11:37:09 +0000 (+0000) Subject: tidy up for running with 'showdx' a bit more. X-Git-Tag: R_1_52~48 X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=commitdiff_plain;h=b80b21be59cd48ebdee1ceeddd739114d6e9ab08 tidy up for running with 'showdx' a bit more. --- diff --git a/cmd/show/dx.pl b/cmd/show/dx.pl index 17a17d27..0728c650 100644 --- a/cmd/show/dx.pl +++ b/cmd/show/dx.pl @@ -86,7 +86,7 @@ while ($f = shift @list) { # next field next; } if (lc $f =~ /^filt/) { - $dofilter = 1 if $self->spotsfilter; + $dofilter = 1 if $self && $self->spotsfilter; next; } if (lc $f eq 'qsl') { @@ -372,7 +372,7 @@ foreach $ref (@res) { if ($self && $self->ve7cc) { push @out, VE7CC::dx_spot($self, @$ref); } else { - if ($real) { + if ($self && $real) { push @out, DXCommandmode::format_dx_spot($self, @$ref); } else { push @out, Spot::formatl(@$ref); diff --git a/perl/DXUser.pm b/perl/DXUser.pm index 3df7fc20..adddce0a 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -212,17 +212,23 @@ sub finish # new - create a new user # -sub new +sub alloc { my $pkg = shift; my $call = uc shift; + my $self = bless {call => $call, 'sort'=>'U'}, $pkg; + return $self; +} + +sub new +{ + my $pkg = shift; + my $call = shift; # $call =~ s/-\d+$//o; # confess "can't create existing call $call in User\n!" if $u{$call}; - my $self = bless {}, $pkg; - $self->{call} = $call; - $self->{'sort'} = 'U'; + my $self = $pkg->alloc($call); $self->put; return $self; } diff --git a/perl/showdx b/perl/showdx index 2ca142c3..bd7696f8 100755 --- a/perl/showdx +++ b/perl/showdx @@ -15,14 +15,13 @@ BEGIN { unshift @INC, "$root/perl"; # this IS the right way round! unshift @INC, "$root/local"; - - sub main::mkver {} } use IO::Handle; use DXUtil; use Bands; use Spot; +use VE7CC; $dxdir = "/spider/cmd/show"; $dxcmd = "dx.pl"; @@ -46,7 +45,7 @@ for (;;) { chomp $myexpr; last if $myexpr =~ /^q$/i; } - my @out = map {"$_\n"} &$dxproc({priv=>0,call=>'GDX'}, $myexpr); + my @out = map {"$_\n"} &$dxproc(undef, $myexpr); shift @out; # remove return code print @out; last if $expr;