Removed holidays and exams
authorTim Pope <code@tpope.net>
Tue, 16 Aug 2005 21:33:33 +0000 (21:33 +0000)
committerTim Pope <code@tpope.net>
Tue, 16 Aug 2005 21:33:33 +0000 (21:33 +0000)
perl/schedproc

index 137d2ea04aa3a7eb720b80b4e2f32a1f3dac50a8..eaaa024664b168e2619163128ed1dd4b76b41dcc 100755 (executable)
@@ -16,49 +16,6 @@ use vars qw(%opts %faculty);
 
 my ($response);
 
-$opts{'holidays'} = { # %{$Profiles->{'US-TX'}},
-    "Martin Luther King Day"    => "3/Mon/Jan",
-    "Good Friday"               => "-2",
-    "Spring Break Monday"      => \&Spring_Break,
-    "Spring Break Tuesday"     => \&Spring_Break,
-    "Spring Break Wednesday"   => \&Spring_Break,
-    "Spring Break Thursday"    => \&Spring_Break,
-    "Spring Break Friday"      => \&Spring_Break,
-    "Spring Break Saturday"    => \&Spring_Break,
-    "Study Day"                 => "4/Thu/Apr", # ?
-    "Memorial Day"              => "5/Mon/May",
-    "Independence Day"          => \&US_Independence,
-    "Labor Day"                 => \&US_Labor,
-    #"Columbus Day"              => "2/Mon/Oct",
-    "Thanksgiving Day"          => "4/Thu/Nov",
-    "Thanksgiving Friday"       => \&Thanksgiving_Friday,
-};
-
-sub Spring_Break {
-    my($year,$label) = @_;
-    $label =~ s/^Spring Break //;
-    return( Add_Delta_Days(
-           Nth_Weekday_of_Month_Year($year,1,1,1),
-           7*(11-1) # This is for the 11th Monday of the year
-           +Decode_Day_of_Week($label)-1) );
-}
-
-sub Thanksgiving_Friday {
-    my($year,$label) = @_;
-    return( Add_Delta_Days(Nth_Weekday_of_Month_Year($year,11,4,4), 1) );
-}
-sub US_Independence # Fourth of July
-{
-    my($year,$label) = @_;
-    return( &Date::Calendar::Profiles::Nearest_Workday($year,7,4) );
-}
-sub US_Labor # First Monday after the first Sunday in September
-{
-    my($year,$label) = @_;
-    return( Add_Delta_Days(
-        Nth_Weekday_of_Month_Year($year,9,7,1), +1) );
-}
-
 my $config = $ENV{HOME} . "/.schedprocrc";
 if (($ARGV[0] || "") eq '-F') {
     shift;
@@ -117,57 +74,6 @@ sub next_class {
     return undef;
 }
 
-sub off_for_holidays {
-    my %class = @_;
-    $class{'duration'} =~ /(\d\d\d\d)(\d\d)(\d\d)-(\d\d\d\d)(\d\d)(\d\d)/;
-    my $days = Delta_Days($1,$2,$3,$4,$5,$6);
-    my $firstday = Date::Calc->new($1,$2,$3);
-    my $lastday = Date::Calc->new($4,$5,$6);
-    my $year = Date::Calendar::Year->new($1, $opts{'holidays'});
-    my @holidays=();
-    my @days=();
-    foreach(split(" ",$class{days})) {
-       $days[Decode_Day_of_Week($_)] = 1;
-    }
-    foreach ($year->search("")) {
-       my $good=1;
-       #foreach my $x ($year->labels($_)) {
-       #    $good=0 if ($x =~ /Veteran/ or $x =~ /President/);
-       #}
-       next unless ($year->is_full($_) && $_>=$firstday && $_<=$lastday);
-       push @holidays, $_
-           if (defined($days[Day_of_Week($_->date)]) && $good > 0);
-    }
-    return wantarray ? @holidays : "@holidays";
-}
-
-sub off_for_exams {
-    my %class = @_;
-    my $time = $class{'begin'} . "-" . $class{'end'};
-    $class{'duration'} =~ /\d{8}-(\d\d\d\d)(\d\d)(\d\d)/;
-    my $lastday = Date::Calc->new($1,$2,$3);
-    return wantarray ? () : undef unless (Day_of_Week($lastday->date) == 7);
-    my $beginning="(08:00-09:15|11:00-12:15|14:00-15:15|17:00-18:15|17:30-18:45|20:00-21:15|20:30-21:45)";
-    my $ending   ="(06:30-07:45|09:30-10:45|12:30-13:45|15:30-16:45|18:30-19:45|19:00-20:15)";
-    my $days = join(" ",map {Decode_Day_of_Week($_)} split(/ /, $class{'days'}));
-    if($days eq "1 3") {
-       if($time =~ /$beginning/) {
-           return $lastday-4;
-       } elsif($time =~ /$ending/) {
-           return $lastday-6;
-       }
-    } elsif($days eq "2 4") {
-       if($time =~ /$beginning/) {
-           return $lastday-3;
-       } elsif($time =~ /$ending/) {
-           return $lastday-5;
-       }
-    } elsif($days eq "5") {
-       return $lastday-2;
-    }
-    return wantarray ? () : "";
-}
-
 sub capitalize {
     local $_ = shift || "";
     s/ +$//;
@@ -234,7 +140,7 @@ sub get_grades {
 }
 
 sub do_html_grades {
-    my ($file, $grades);
+    my $grades);
     my @showheaders = ("Section ID", "Course Title", "Grade", "Earned<br />Hours", "Quality<br />Hours", "Quality<br />Points");
     #$file = shift unless (!defined $_[0] or $_[0] =~ /^\d/);
     $grades = get_grades(@_);