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:
0e0d6dc
)
"TBA" handling, midnight to military time
author
Tim Pope
<code@tpope.net>
Thu, 11 Aug 2005 04:30:27 +0000
(
04:30
+0000)
committer
Tim Pope
<code@tpope.net>
Thu, 11 Aug 2005 04:30:27 +0000
(
04:30
+0000)
perl/sct6
patch
|
blob
|
history
diff --git
a/perl/sct6
b/perl/sct6
index e6c66602149a2e1c1dbe0f524d0ac43d3655a781..9178a710bb1cd30260537d11f12610dbdb728871 100755
(executable)
--- a/
perl/sct6
+++ b/
perl/sct6
@@
-251,19
+251,19
@@
sub get_schedule {
$classid =~ s/.* - //;
$classid =~ s/ /-/g;
$title =~ s/ - .*//;
$classid =~ s/.* - //;
$classid =~ s/ /-/g;
$title =~ s/ - .*//;
+ $row->[6] =~ s/\b([A-Z]r?)$/$1./;
$row->[6] = capitalize($row->[6]);
$row->[6] = capitalize($row->[6]);
- $row->[6] =~ s/([A-Z]r?)$/$1./;
$row->[6] =~ s/ *\([A-Z]\)//;
$row->[1] =~ s/ ?([ap])m/\u$1M/g;
$row->[1] =~ s/ - /-/;
($begin, $end) = split(/ ?- ?/, $row->[1]);
$begin =~ s/^(\d):/0$1:/;
$end =~ s/^(\d):/0$1:/;
$row->[6] =~ s/ *\([A-Z]\)//;
$row->[1] =~ s/ ?([ap])m/\u$1M/g;
$row->[1] =~ s/ - /-/;
($begin, $end) = split(/ ?- ?/, $row->[1]);
$begin =~ s/^(\d):/0$1:/;
$end =~ s/^(\d):/0$1:/;
- if (
$begin =~ /pm$/i && $begin !~ /^12/
) {
- $begin =~ s/^(\d?\d)/
$1+12
/e;
+ if (
($begin=~/PM$/ && $begin!~/^12/)||($begin=~/^12:..AM/)
) {
+ $begin =~ s/^(\d?\d)/
($1+12)%24
/e;
}
}
- if (
$end =~ /pm$/i && $end !~ /^12/
) {
- $end =~ s/^(\d?\d)/
$1+12
/e;
+ if (
($end=~/PM$/ && $end!~/^12/)||($end=~/^12:..AM/)
) {
+ $end =~ s/^(\d?\d)/
($1+12)%24
/e;
}
$begin =~ s/ ?[AP]M//;
$end =~ s/ ?[AP]M//;
}
$begin =~ s/ ?[AP]M//;
$end =~ s/ ?[AP]M//;
@@
-275,17
+275,17
@@
sub get_schedule {
push @schedule, {
id => $classid,
title => $title,
push @schedule, {
id => $classid,
title => $title,
- #session => $row->[1],
instructor => $row->[6],
instructor => $row->[6],
- #credits => $row->[3],
- #callnumber => $row->[4],
- #gradetype => $row->[5],
days => $row->[2],
'time' => $row->[1],
begin => $begin,
end => $end || undef,
duration => $row->[4],
location => $row->[3],
days => $row->[2],
'time' => $row->[1],
begin => $begin,
end => $end || undef,
duration => $row->[4],
location => $row->[3],
+ #session => $row->[1],
+ #credits => $row->[3],
+ #callnumber => $row->[4],
+ #gradetype => $row->[5],
#message => $row->[10],
};
}
#message => $row->[10],
};
}
@@
-579,10
+579,7
@@
sub do_transcripts {
}
}
}
}
-if ($arg eq "-g") {
- die "Grade support currently broken.\n";
- do_html_grades(@ARGV);
-} elsif ($arg eq "-s") {
+if ($arg eq "-s") {
do_html_schedule(@ARGV);
} elsif ($arg eq "-m") {
do_mhc_schedule(@ARGV);
do_html_schedule(@ARGV);
} elsif ($arg eq "-m") {
do_mhc_schedule(@ARGV);
@@
-590,6
+587,9
@@
if ($arg eq "-g") {
do_csv_schedule(@ARGV);
} elsif ($arg eq "-v") {
do_vcalendar_schedule(@ARGV);
do_csv_schedule(@ARGV);
} elsif ($arg eq "-v") {
do_vcalendar_schedule(@ARGV);
+} elsif ($arg eq "-g") {
+ die "Grade support currently broken.\n";
+ do_html_grades(@ARGV);
} elsif ($arg eq "-t") {
die "Transcript support currently broken.\n";
do_transcripts;
} elsif ($arg eq "-t") {
die "Transcript support currently broken.\n";
do_transcripts;