[Thread Prev][Thread Next][Thread Index]

Re: SyncMemo, v1.04



Alan, thanks for writing SyncMemo.  I use it every day.

	Your method of maintaining a set of directories of data files will
work just as well on todo's or even addresses.  It might work as well on
any simple list of categorized records (jshopper, for instance).

	I've hacked version 1.03 of SynMemo to work on ToDo's.  It's not
done, and probably never will be, since you're on 1.04, and I'll probably
make the same changes in that.  (Currently, some toDo's get deleted, and
the files get currupted by the "merge" function.)

	It's a shame, though.  You've done all this great work, and may do
more, and here I am completely diverting, doing a search and replace on
"Memo" to "ToDo" in your source code.  It's really, really ugly and the
wrong way to do it.

	Could you produce (or could someone, please, produce) a GENERIC
version of your program, which has a small number of routines/variables
which are specific to a type?  Then all the modification checking and
communications routines you have written could be used lock, stock and
barrel, without any change, and wouldn't need much change to be
updated when you make enhancements.

	Thanks for all your work!

	I've written a ToDo manager in tcl/tk, based on the output of this
conduit, and will be releasing that early next week.

# # #
	The following are the truely ugly changes I made to 1.03 to get it
to work on ToDo's.  I don't suggest anyone follow this path unless the
pilot data is not important, since this does destroy data.  But I suspect
only about ten more lines need to be changed to make it as reliable as
SynMemo.

 (Oh, one more caveat -- the following has the word ToDo translated to Memo
in my source -- that's how I made the diff.  Every instance of Memo was
changed to ToDo as a first step.)

# diff -a SyncMemo.pm SyncTodo.pm.modified
184a185
>     my ($blob,$junk);
210,215c211,216
<       if (%oldsum)
<       {
<           PilotMgr::msg("Reading Pilot Memos [fast sync]");
<           %pilot = &readChangedMemos($pilot_sock, $pilot_dbhandle);
<           $fullsync = 0;
<       } else {
---
> #     if (%oldsum)
> #     {
> #         PilotMgr::msg("Reading Pilot Memos [fast sync]");
> #         %pilot = &readChangedMemos($pilot_sock, $pilot_dbhandle);
> #         $fullsync = 0;
> #     } else {
219c220
<       }
---
> #     }
233,234c234,242
<           $memo{text} = `cat $file`;
<           unless ($memo{text})
---
>           $blob = `cat $file`;
>     ($Memo{indefinite},$Memo{tm_mon},$Memo{tm_mday},$Memo{tm_year},$Memo{priority},$Memo{complete},$junk) = $blob =~ /^([0-9]+),([0-9]+)\/([0-9]+)\/([0-9]+),([0-9]+),([0-9]+),([0-9]+)/;
>     $blob =~ s/^([0-9]+),([0-9]+)\/([0-9]+)\/([0-9]+),([0-9]+),([0-9]+),([0-9]+)//;
>     ($Memo{description},$junk) = $blob =~ /(.{$junk}),([0-9]+),/;
>     $blob =~ s/(.{$junk}),([0-9]+),//;
>     ($Memo{note}) = $blob =~ /(.{$junk})/;
>       
>         PilotMgr::msg("File: ".$Memo{description}.", ".$Memo{note});
>           unless ($Memo{description})
259c267
<               } elsif ($memo{text} ne $pilot{$memo{pilot_id}}->{text}) {
---
>               } elsif ($Memo{description} ne $pilot{$Memo{pilot_id}}->{description}) {
267,268c275,276
<                                         $memo{text},
<                                         $pilot{$memo{pilot_id}}->{text});
---
>                                         $Memo{description},
>                                         $pilot{$Memo{pilot_id}}->{description});
275c283
<                       $ret = $memo{text} .
---
>                       $ret = $Memo{description} .
277c285
<                              $pilot{$memo{pilot_id}}->{text};
---
>                              $pilot{$Memo{pilot_id}}->{description};
279c287
<                   $memo{text} = $ret;
---
>                   $Memo{description} = $ret;
375c383,390
<               print FD $pilot{$i}->{text};
---
> print FD $pilot{$i}->{indefinite}.",";
> print FD $pilot{$i}->{tm_mon}."/";
> print FD $pilot{$i}->{tm_mday}."/";
> print FD $pilot{$i}->{tm_year}.",";
> print FD $pilot{$i}->{priority}.",";
> print FD $pilot{$i}->{complete}.",";
> print FD length($pilot{$i}->{description}).",".$pilot{$i}->{description}.",";
> print FD length($pilot{$i}->{note}).",".$pilot{$i}->{note}."\n";
499c514
<               $rec->{text} eq $pi->{text})
---
>               $rec->{description} eq $pi->{description})
631a647
>       PilotMgr::msg("1 Record: ".$db{$id}{description});
682c698,705
<     $memo{text} = $pi_addr->{text};
---
>     $Memo{indefinite} = $pi_addr->{indefinite};
> $Memo{tm_year} = ${$pi_addr->{due}}{tm_year};
> $Memo{tm_mday} = ${$pi_addr->{due}}{tm_mday};
> $Memo{tm_mon} = ${$pi_addr->{due}}{tm_mon};
>     $Memo{priority} = $pi_addr->{priority};
>     $Memo{complete} = $pi_addr->{complete};
>     $Memo{description} = $pi_addr->{description};
>     $Memo{note} = $pi_addr->{note};
683a707
> 
696c720
<     $pi_memo->{text} = $memo{text};
---
>     $pi_Memo->{description} = $Memo{description};


SourceForge.net Logo