hta@isolde.Berkeley.EDU (Harald Tveit Alvestrand) (02/21/91)
Hello, world.
I have just entered the brave new world of CalendarManager, and of course
I have some troubles:
- I REALLY HATE doing times in AMPM notation. Is there any possible way
to force CM to operate in 00:00-24:00 format instead?
- A milder form of the same irritation is the fact that I have to schedule
something for "Wed February 20, 1991", when I commonly use
"Ons 20 Februar 1991", which is the Norwegian language version.
- A documentation nit: Is there anything stating the format of the file
where all the info is stored - or guaranteeing that it is reasonably stable?
Just to tell you why I would like the last point, I attach my fresh PERL script
to list ALL the entries in my calendar....
Harald Tveit Alvestrand
Harald.Alvestrand@elab-runit.sintef.no
C=no;PRMD=uninett;O=sintef;OU=elab-runit;S=alvestrand;G=harald
+47 7 59 70 94
============================ Cut here ==========================
#!/local/bin/perl
# Hubris in action: List the entries of the CM calendar
# Harald.Alvestrand@elab-runit.sintef.no wrote this; don't blame him!
#
%monthtable = ("Jan", 1, "Feb", 2, "Mar", 3, "Apr", 4, "May", 5, "Jun", 6,
"Jul", 7, "Aug", 8, "Sep", 9, "Oct", 10, "Nov", 11, "Dec", 12 );
$user = (getpwuid($<))[0];
open(CAL, "/var/spool/calendar/callog.$user");
while (<CAL>) {
if (/^\(add "(.*)" key: \d* what: "([^"]*)"/) {
$rest = $';
$starttime = $1;
$item = $2;
# Massage....
# Sortable time
if ($starttime =~ /^\S\S\S (\S\S\S) ([ \d]{2}) ([:\d]{8}) (\d{4})/) {
$mnthno = $monthtable{$1};
$sorttime = sprintf("%4d %2d %2d %s", $4, $mnthno, $2, $3);
} else {
print STDERR "Not parsed: $starttime\n";
}
# Append short description for repeaters
if ($rest =~ /period: (\S*) ntimes: (\d*)/) {
$period = $1; $ntimes = $2;
if ($period ne 'single') {
if ($period eq 'daily') { $period = 'dager'; }
$item .= " ($ntimes $period)";
}
}
$starttime =~ s/03:41:00/--------/;
$listing{$sorttime} = sprintf("%-15s %s\n", $starttime, $item);
} elsif (/^\(access/ || /^Version/ || /^\*\*\*\*/ || /^$/) {
} else {
print STDERR "Unknown: $_";
}
}
for $key (sort(keys(%listing))) {
print $listing{$key};
}