Skip to content
Snippets Groups Projects
Select Git revision
  • 6067feb0a3d4945087a1dd1af6cce32ad5fc8f32
  • master default protected
  • djmdev
  • dev
  • cloud_water_contents
  • 1-download-era5
  • sysinstall
  • origin/task/language-editing
  • task/language-editing
  • feature/makefiles
  • v7.1.2
  • v7.1.1
  • v7.1
  • v7.0.4.1
  • 7.0.4
15 results

CONTROL_EA5

Blame
  • Directory.pm 3.98 KiB
    #
    # scan directory with note files in Tomboy format
    #
    
    =head1 NAME
    
      Tomboy::Directory
    
    =head1 SYNOPSIS
    
    =head1 DESCRIPTION
    
    process a directory containing note files in Tomboy format
    
    =head1 SYNOPSIS
    
      my $tb_dir= new Tomboy::Directory;
      $tb_toc= $tb_dir->scan_dir ($directory);
    
    =cut
    
    package Tomboy::Directory;
    
    use strict;
    
    use Data::Dumper;
    $Data::Dumper::Indent= 1;
    
    use Tomboy::Note::Simple;
    
    # attributes read from the note itself or from the filesystem
    my @TB_note_attrs= qw(title create-date last-change-date last-metadata-change-date notebook is_template fnm);
    my @TB_meta_attrs= qw(uuid mtime size ino);
    =head1 METHODS
    
    =head2 my $tb_dir= new Tomboy::Directory()
    
    creates a new directory object
    
    =cut
    
    sub new
    {
      my $class= shift;
      my %par= @_;
    
      my $obj= {};
      bless $obj, $class;
    
      foreach my $par (keys %par)
      {
        $obj->{$par}= $par{$par};
        if ($par eq 'dir') { $obj->scan_dir ($par{$par}) }
      }
    
      $obj;
    }
    
    =head2 $tb_dir->scan_dir ($directory, ($rows, $quick]))
    
    Scan named directory for Tomboy notes and extract key features using
    Tomboy::Note::Simple.  These features are placed into a record and all
    these records are returned as array reference.
    
    Optionally pass an array reference of such records as $rows and when
    $quick has a true value, the note files are only processed when they
    do not appear to be modified, otherwise the earlier record is passed in
    the result set.
    
    =cut