Skip to content
Snippets Groups Projects
Commit a574861f authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

Merge branch 'master' of github.com:gonter/docu-tools

parents 4c60fef9 b9fd7a2e
No related branches found
No related tags found
No related merge requests found
docu-tools.creator.user
// Add predefined macros for your project here. For example:
// #define THE_ANSWER 42
[General]
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
perl/Gnome-Tomboy
......@@ -6,7 +6,7 @@
=head1 DESCRIPTION
utility functions to work with Tomboy
utility functions to work with Tomboy files
=head1 SYNOPSIS
......
......@@ -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;
......
......@@ -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
{
if ($verbosity eq 'title')
{
print $rec->{'title'}, "\n";
}
else
{
print Dumper ($uuid{$uuid});
print Dumper ($rec);
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment