Changeset 10420
- Timestamp:
- Dec 3, 2006, 8:43:40 AM (19 years ago)
- File:
-
- 1 edited
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/PS-IPP-Config/lib/PS/IPP/Config.pm
r10332 r10420 1 1 # Copyright (c) 2006 Paul Price, Joshua Hoblitt 2 2 # 3 # $Id: Config.pm,v 1. 7 2006-12-01 02:24:27 price Exp $3 # $Id: Config.pm,v 1.8 2006-12-03 18:43:40 eugene Exp $ 4 4 5 5 package PS::IPP::Config; … … 90 90 } 91 91 92 93 # select a datapath from config.site 94 sub datapath 95 { 96 my $self = shift; # Configuration object 97 my $name = shift; # datapath name 98 99 my $path_list = _mdLookupMD($self->{_ipprc}, 'DATAPATH'); # List of cameras 100 my $pathname = _mdLookupStr($path_list, $name); # Filename of camera configuration 101 croak "Unable to find camera configuration file $pathname\n" if not defined $pathname; 102 103 return $pathname; 104 } 105 106 sub convert_filename 107 { 108 my $self = shift; # Configuration object 109 my $name = shift; # raw name 110 my $base; 111 112 my $abspath = false; 113 114 # strip off file:// prefix 115 $name =~ s|^file://||; 116 117 # replace path://PATH with datapath lookup 118 if ($name =~ m|^path://|) { 119 ($base) = $name =~ m|^path://(.*)|; 120 my @list = split ("/", $base); 121 my $path = shift @list; 122 my $realpath = $self->datapath($path); 123 unshift @list, $realpath; 124 $name = join ("/", @list); 125 } 126 127 # if we have a relative path in the end, prepend WORKDIR 128 unless ($name =~ m|^/|) { 129 my $workdir = $self->workdir(); 130 if defined $workdir { 131 $name = File::Spec->rel2abs( $name, $workdir); 132 } 133 } 134 135 return $name; 136 } 92 137 93 138 # Return a rejection limit from the camera configuration
Note:
See TracChangeset
for help on using the changeset viewer.
