diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..009fc50df21bd091d5e3405f1872d2d380e87906 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +docu-tools.creator.user diff --git a/docu-tools.config b/docu-tools.config new file mode 100644 index 0000000000000000000000000000000000000000..e0284f42573a21b9d3f32775068f4dc233bf1c27 --- /dev/null +++ b/docu-tools.config @@ -0,0 +1,2 @@ +// Add predefined macros for your project here. For example: +// #define THE_ANSWER 42 diff --git a/docu-tools.creator b/docu-tools.creator new file mode 100644 index 0000000000000000000000000000000000000000..e94cbbd3027df32cb00f4fca093d5c72d9696a85 --- /dev/null +++ b/docu-tools.creator @@ -0,0 +1 @@ +[General] diff --git a/docu-tools.files b/docu-tools.files new file mode 100644 index 0000000000000000000000000000000000000000..8b3684aeb3e252e632c1c88bba238419f39102da --- /dev/null +++ b/docu-tools.files @@ -0,0 +1,11 @@ +perl/Gnome-Tomboy/lib/Tomboy/Note/Simple.pm +perl/Gnome-Tomboy/lib/Tomboy/Directory.pm +perl/Gnome-Tomboy/lib/Tomboy/TOC.pm +perl/Gnome-Tomboy/lib/Tomboy.pm +perl/Gnome-Tomboy/s1.pl +perl/Gnome-Tomboy/s2.pl +perl/Gnome-Tomboy/s3.pl +perl/Gnome-Tomboy/x_uuid.pl +perl/Wiki-Confluence/lib/Wiki/Confluence.pm +perl/Wiki-Confluence/scripts/cfl1.pl +perl/Gnome-Tomboy/tom diff --git a/docu-tools.includes b/docu-tools.includes new file mode 100644 index 0000000000000000000000000000000000000000..67e3be526b32ff930a38c01a83b373ccd671b523 --- /dev/null +++ b/docu-tools.includes @@ -0,0 +1 @@ +perl/Gnome-Tomboy diff --git a/perl/Gnome-Tomboy/lib/Tomboy.pm b/perl/Gnome-Tomboy/lib/Tomboy.pm index bc1344b3b868f1ca9f9033266742bd8afa1c1cc8..438a14efc452a15951873d126d39aa1eb358545b 100644 --- a/perl/Gnome-Tomboy/lib/Tomboy.pm +++ b/perl/Gnome-Tomboy/lib/Tomboy.pm @@ -6,7 +6,7 @@ =head1 DESCRIPTION -utility functions to work with Tomboy +utility functions to work with Tomboy files =head1 SYNOPSIS diff --git a/perl/Gnome-Tomboy/lib/Tomboy/Note/Simple.pm b/perl/Gnome-Tomboy/lib/Tomboy/Note/Simple.pm index 1d397efa5126509b047118d7a039193ae1a3db5b..4274bcd304484557eee6fa871c2fa5a9c440a454 100755 --- a/perl/Gnome-Tomboy/lib/Tomboy/Note/Simple.pm +++ b/perl/Gnome-Tomboy/lib/Tomboy/Note/Simple.pm @@ -522,6 +522,7 @@ sub save my $note= shift; my $out_dir= shift; my $fnm_out= shift; + my $no_utf8= shift; # refresh lines, if they are not up-to-date $note->update() unless ($note->{'flg_lines'}); @@ -556,7 +557,14 @@ sub save $fnm_out.= $uuid . '.note'; } - unless (open (FO, '>:utf8', $fnm_out)) + my $out_mode= '>:utf8'; + if ($no_utf8) + { + print "save with no utf8!\n"; + $out_mode= '>:encoding(iso-8859-7)'; + } + + unless (open (FO, $out_mode, $fnm_out)) { print STDERR "can't write to [$fnm_out]\n"; return undef; diff --git a/perl/Gnome-Tomboy/tom b/perl/Gnome-Tomboy/tom index c6a06b9a2d4d222e3d2b0ad4d894e2346bfb8dfb..250f05c3ee6eea456dedefc55d8f5786bba0c671 100755 --- a/perl/Gnome-Tomboy/tom +++ b/perl/Gnome-Tomboy/tom @@ -50,6 +50,7 @@ use Tomboy::Note::Simple; use Tomboy::Directory; use Tomboy::TOC; +my $toc; my $toc_file; my $note_dir_changed= 0; @@ -58,7 +59,7 @@ my ($note_dir)= Tomboy::paths(); my $start_tb= 0; my $start_visual_editor= 0; # AKA $EDITOR my $dump_note= 0; -my $toc; +my $verbosity= 'dump'; my $op_code; my @PAR; @@ -94,6 +95,7 @@ while (my $arg= shift (@ARGV)) { if ($a eq 'd') { $note_dir= shift (@ARGV); $note_dir_changed= 1; } elsif ($a eq 't') { $toc_file= shift (@ARGV); } + elsif ($a eq 'T') { $verbosity= 'title'; } elsif ($a eq 'e') { $start_tb= 1; } elsif ($a eq 'v') { $start_visual_editor= 1; } elsif ($a eq 'D') { $dump_note= 1; } @@ -203,6 +205,7 @@ sub setup_toc $toc_file= join ('/', $note_dir, 'Tomboy-TOC.csv') unless (defined ($toc_file)); $toc= new Tomboy::TOC('note_dir' => $note_dir, 'toc_file' => $toc_file); # print "toc: ", Dumper ($toc); + return ($toc_file, $toc); } sub tom_toc @@ -226,8 +229,11 @@ sub find_note foreach my $res (@res) { $uuid{$res->{'uuid'}}= $res; } # TODO: count hits } + print '='x72, "\n"; foreach my $uuid (keys %uuid) { + my $rec= $uuid{$uuid}; + if ($start_tb) { my @par= ('uuid' => $uuid); @@ -243,11 +249,18 @@ sub find_note } elsif ($dump_note) { - dump_note($uuid{$uuid}->{'fnm'}); + dump_note($rec->{'fnm'}); } else { - print Dumper ($uuid{$uuid}); + if ($verbosity eq 'title') + { + print $rec->{'title'}, "\n"; + } + else + { + print Dumper ($rec); + } } } }