projects
/
tpope-extra.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
8303084
)
Changes to treatment of faculty
author
Tim Pope
<code@tpope.net>
Sun, 21 Aug 2005 00:20:19 +0000
(
00:20
+0000)
committer
Tim Pope
<code@tpope.net>
Sun, 21 Aug 2005 00:20:19 +0000
(
00:20
+0000)
perl/schedproc
patch
|
blob
|
history
diff --git
a/perl/schedproc
b/perl/schedproc
index 8c45f83bbd334fde796f909982f554c92be2b348..b3bd248f79d0ddd5399534c8ba83b56b2528e496 100755
(executable)
--- a/
perl/schedproc
+++ b/
perl/schedproc
@@
-40,7
+40,7
@@
if($arg eq "-x") {
Getopt::Long::Configure ("bundling", "auto_help");
die "Invalid arguments\n" unless
Getopt::Long::Configure ("bundling", "auto_help");
die "Invalid arguments\n" unless
-GetOptions(\%opts, 'schedule|S=s', 'grades|G=s', 'fac
mail=s', 'facurl
=s', 'name|n=s', 'format|f=s', 'config|F=s', 'out|o=s');
+GetOptions(\%opts, 'schedule|S=s', 'grades|G=s', 'fac
ulty
=s', 'name|n=s', 'format|f=s', 'config|F=s', 'out|o=s');
if (-r $opts{'config'}) {
open CONFIG, $opts{'config'} or die $!;
if (-r $opts{'config'}) {
open CONFIG, $opts{'config'} or die $!;
@@
-48,7
+48,7
@@
if (-r $opts{'config'}) {
s/\#.*//;
next unless m/^([^=]*)=(.*)/;
my ($l, $r) = ($1, $2);
s/\#.*//;
next unless m/^([^=]*)=(.*)/;
my ($l, $r) = ($1, $2);
- if ($l =~ /^(schedule|grades|name|fac
mail|facurl
)$/) {
+ if ($l =~ /^(schedule|grades|name|fac
ulty
)$/) {
$opts{$l}||=$r;
} else {
warn "Unknown config file option $l.\n";
$opts{$l}||=$r;
} else {
warn "Unknown config file option $l.\n";
@@
-59,13
+59,11
@@
if (-r $opts{'config'}) {
$opts{'schedule'} ||= "~/schedule.xml";
$opts{'grades'} ||= "~/grades.xml";
$opts{'schedule'} ||= "~/schedule.xml";
$opts{'grades'} ||= "~/grades.xml";
-$opts{'facmail'} ||= "";
-$opts{'facurl'} ||= "";
+$opts{'faculty'} ||= "";
$opts{'schedule'} =~ s/(^|,)~\//$1$ENV{HOME}\//;
$opts{'grades'} =~ s/(^|,)~\//$1$ENV{HOME}\//;
$opts{'schedule'} =~ s/(^|,)~\//$1$ENV{HOME}\//;
$opts{'grades'} =~ s/(^|,)~\//$1$ENV{HOME}\//;
-$opts{'facmail'} =~ s/(^|,)~\//$1$ENV{HOME}\//;
-$opts{'facurl'} =~ s/(^|,)~\//$1$ENV{HOME}\//;
+$opts{'faculty'} =~ s/(^|,)~\//$1$ENV{HOME}\//;
if(!defined($opts{'out'}) && defined($ARGV[0])) {
$opts{'out'} = shift;
if(!defined($opts{'out'}) && defined($ARGV[0])) {
$opts{'out'} = shift;
@@
-177,17
+175,18
@@
sub get_grades {
}
sub get_faculty_email {
}
sub get_faculty_email {
- my ($name, $
school, $emai
l);
- if((-f ($opts{'fac
mail
'}||"")) && ! %faculty) {
- open INS,$opts{'fac
mail
'} or die $!;
+ my ($name, $
email, $ur
l);
+ if((-f ($opts{'fac
ulty
'}||"")) && ! %faculty) {
+ open INS,$opts{'fac
ulty
'} or die $!;
while($_ = <INS>) {
chomp;
m/"([^"]*)",([^,]*),([^,]*)/; # "
while($_ = <INS>) {
chomp;
m/"([^"]*)",([^,]*),([^,]*)/; # "
- ($name, $email, $
schoo
l) = ($1, $2, $3);
+ ($name, $email, $
ur
l) = ($1, $2, $3);
$name =~ s/ [A-Z]\.//g;
$name = lc $name;
$name =~ s/\W//g;
$faculty{$name} = $email;
$name =~ s/ [A-Z]\.//g;
$name = lc $name;
$name =~ s/\W//g;
$faculty{$name} = $email;
+ $facurul{$name} = $urll;
}
}
$name = shift;
}
}
$name = shift;
@@
-198,16
+197,17
@@
sub get_faculty_email {
}
sub get_faculty_url {
}
sub get_faculty_url {
- my ($name, $url);
- if((-f ($opts{'facu
rl'}||"")) && ! %facurl
) {
- open INS, $opts{'facu
rl
'} or die $!;
+ my ($name, $
email, $
url);
+ if((-f ($opts{'facu
lty'}||"")) && ! %faculty
) {
+ open INS, $opts{'facu
lty
'} or die $!;
while($_ = <INS>) {
chomp;
while($_ = <INS>) {
chomp;
- m/([^,]*),([^,]*)/; # "
- ($name, $
url) = ($1, $2
);
+ m/
"([^"]*)",
([^,]*),([^,]*)/; # "
+ ($name, $
email, $url) = ($1, $2, $3
);
$name =~ s/ [A-Z]\.//g;
$name = lc $name;
$name =~ s/\W//g;
$name =~ s/ [A-Z]\.//g;
$name = lc $name;
$name =~ s/\W//g;
+ $faculty{$name} = $email;
$facurl{$name} = $url;
}
}
$facurl{$name} = $url;
}
}
@@
-421,10
+421,10
@@
sub do_html_schedule {
#$instructor =~ s/ [A-Z. ]* / /;
my $url = get_faculty_url($row->{'instructor'});
if($url) {
#$instructor =~ s/ [A-Z. ]* / /;
my $url = get_faculty_url($row->{'instructor'});
if($url) {
- print '<td><a href="' . $url . '">'
+ print '<td
class="instructor"
><a href="' . $url . '">'
. $row->{'instructor'} . "</a></td>";
} else {
. $row->{'instructor'} . "</a></td>";
} else {
- print
"<td>"
. $instructor . "</td>";
+ print
'<td class="instructor">'
. $instructor . "</td>";
}
print "<td>" . $row->{'days'} . "</td>";
my ($a,$b) = ($row->{'begin'}, $row->{'end'});
}
print "<td>" . $row->{'days'} . "</td>";
my ($a,$b) = ($row->{'begin'}, $row->{'end'});