Palm-Progect
view release on metacpan or search on metacpan
lib/Palm/Progect/Converter/Text.pm view on Meta::CPAN
push @line, '< >';
}
}
else {
if ($record->completed) {
push @line, '[x]';
}
else {
push @line, '[ ]';
}
}
}
elsif ($record->type == RECORD_TYPE_PROGRESS) {
push @line, '[' . ($record->completed() || 0). '%]';
}
elsif ($record->type == RECORD_TYPE_NUMERIC) {
push @line, "[" . ($record->completed_actual || 0) . '/' . ($record->completed_limit || 0). "]";
}
elsif ($record->type == RECORD_TYPE_INFO) {
push @line, ".";
}
if ($record->priority) {
push @line, '[' . $record->priority . ']';
}
if ($record->date_due) {
push @line, "(" . format_date($record->date_due, $self->date_format) . ")";
}
if ($record->category_name) {
push @line, "{" . $record->category_name . "}";
}
my $desc = $record->description;
my $para_indent = $record_indent.$indent;
$desc =~ s/\n/ /g;
push @line, $desc;
if ($record->note) {
my $note = $record->note;
if ($self->columns) {
$note = wrap('', $para_indent, $note);
}
$note = "<<\n$para_indent$note\n$para_indent>>";
$note = _expand_tabs($note, $self->tabstop) if $self->fill_with_spaces;
push @line, $note;
}
print FH "${record_indent}", join ' ', @line;
print FH "\n";
}
print FH "\n";
close FH;
}
sub load_prefs {
}
sub save_prefs {
}
sub _expand_tabs {
my ($string, $tabstop) = @_;
$string =~ s/\t/' ' x $tabstop/ge;
return $string;
}
sub _trim_lines {
my ($whitespace, $tabstop, @lines) = @_;
$whitespace = _expand_tabs($whitespace, $tabstop);
foreach my $line (@lines) {
$line = _expand_tabs($line, $tabstop);
$line =~ s/^$whitespace//;
}
return @lines;
}
# sub db_name_from_filename {
# my $filename = shift;
# $filename =~ tr{\\}{/};
# $filename =~ tr{:}{/};
# $filename = (split m{/}, $filename)[-1];
# $filename =~ s/^lbPG-//;
# $filename =~ s/\..*?$//;
# return $filename;
# }
#
# sub expand_tabs {
# my ($string, $tabstop) = @_;
# $string =~ s/\t/' ' x $tabstop/ge;
# return $string;
# }
#
# sub trim_lines {
# my ($whitespace, $tabstop, @lines) = @_;
#
# $whitespace = expand_tabs($whitespace, $tabstop);
#
# foreach my $line (@lines) {
# $line = expand_tabs($line, $tabstop);
# $line =~ s/^$whitespace//;
# }
# return @lines;
# }
#
#
#
1;
__END__
Example:
@ setting_foo : 1
@ setting_bar : 2
( run in 0.538 second using v1.01-cache-2.11-cpan-8f98c5d2c55 )