r31749 - in /trunk/libfinance-bank-ie-permanenttsb-perl: ./ debian/ debian/patches/ lib/ lib/Finance/Bank/IE/ lib/Finance/Bank/IE/templates/ t/

antonio-guest at users.alioth.debian.org antonio-guest at users.alioth.debian.org
Sun Mar 8 23:08:00 UTC 2009


Author: antonio-guest
Date: Sun Mar  8 23:07:57 2009
New Revision: 31749

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=31749
Log:
* New upstream release
* debian/patches/*:
  + removal of the entire directory because fix-pod-errors was incorporated
    upstream
* debian/rules: removal of quilt dependency
* debian/watch
  + removed repack.sh because upstream incorporate our suggestions
* debian/copyright: removed notice for repack.sh
* debian/control:
  + added libtest-mockobject-perl, libwww-mechanize-perl and libdate-calc-perl
    dependencies

Added:
    trunk/libfinance-bank-ie-permanenttsb-perl/COPYING
      - copied unchanged from r31737, branches/upstream/libfinance-bank-ie-permanenttsb-perl/current/COPYING
    trunk/libfinance-bank-ie-permanenttsb-perl/t/
      - copied from r31737, branches/upstream/libfinance-bank-ie-permanenttsb-perl/current/t/
Removed:
    trunk/libfinance-bank-ie-permanenttsb-perl/debian/patches/
    trunk/libfinance-bank-ie-permanenttsb-perl/debian/repack.sh
Modified:
    trunk/libfinance-bank-ie-permanenttsb-perl/Changes
    trunk/libfinance-bank-ie-permanenttsb-perl/MANIFEST
    trunk/libfinance-bank-ie-permanenttsb-perl/META.yml
    trunk/libfinance-bank-ie-permanenttsb-perl/TODO
    trunk/libfinance-bank-ie-permanenttsb-perl/debian/changelog
    trunk/libfinance-bank-ie-permanenttsb-perl/debian/control
    trunk/libfinance-bank-ie-permanenttsb-perl/debian/copyright
    trunk/libfinance-bank-ie-permanenttsb-perl/debian/rules
    trunk/libfinance-bank-ie-permanenttsb-perl/debian/watch
    trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/PermanentTSB.pm
    trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/templates/gnuplot_print.gp
    trunk/libfinance-bank-ie-permanenttsb-perl/lib/ptsb_util.pm
    trunk/libfinance-bank-ie-permanenttsb-perl/ptsb

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/Changes?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/Changes (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/Changes Sun Mar  8 23:07:57 2009
@@ -1,6 +1,10 @@
 Revision history for Perl extension Finance::Bank::IE::PermanentTSB.
 
-0.2 Fri Jan 30 13:49:07 GMT 2009
+0.4
+
+    - Implement CSV export
+
+0.2 and 0.3 Fri Jan 30 13:49:07 GMT 2009
 
     - Implemented graphs using gnuplot
       Graph can be viewed and saved on the filesystem using

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/MANIFEST?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/MANIFEST (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/MANIFEST Sun Mar  8 23:07:57 2009
@@ -2,9 +2,11 @@
 Makefile.PL
 MANIFEST
 README
+t/Finance-Bank-IE-PermanentTSB.t
 lib/Finance/Bank/IE/PermanentTSB.pm
 lib/Finance/Bank/IE/templates/gnuplot_print.gp
 lib/ptsb_util.pm
 ptsb
 TODO
 META.yml #Module meta-data (added by MakeMaker)
+COPYING

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/META.yml?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/META.yml (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/META.yml Sun Mar  8 23:07:57 2009
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Finance-Bank-IE-PermanentTSB
-version:      0.2
+version:      0.4
 version_from: lib/Finance/Bank/IE/PermanentTSB.pm
 installdirs:  site
 requires:

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/TODO
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/TODO?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/TODO (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/TODO Sun Mar  8 23:07:57 2009
@@ -2,6 +2,8 @@
 ====
 
 - convert to OOP rather than functional programming
+- mobile_topup and money_transfer (with check >50)
+- Graphical Interface?
 
 IN PROGRESS
 ===========

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/debian/changelog?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/debian/changelog (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/debian/changelog Sun Mar  8 23:07:57 2009
@@ -1,3 +1,19 @@
+libfinance-bank-ie-permanenttsb-perl (0.4-1) unstable; urgency=low
+
+  * New upstream release
+  * debian/patches/*:
+    + removal of the entire directory because fix-pod-errors was incorporated
+      upstream
+  * debian/rules: removal of quilt dependency
+  * debian/watch
+    + removed repack.sh because upstream incorporate our suggestions
+  * debian/copyright: removed notice for repack.sh
+  * debian/control:
+    + added libtest-mockobject-perl, libwww-mechanize-perl and libdate-calc-perl
+      dependencies
+
+ -- Antonio Radici <antonio at dyne.org>  Sun, 08 Mar 2009 22:42:26 +0000
+
 libfinance-bank-ie-permanenttsb-perl (0.2+dfsg.1-1) unstable; urgency=low
 
   * Initial Release. (Closes: #513699)

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/debian/control?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/debian/control (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/debian/control Sun Mar  8 23:07:57 2009
@@ -1,8 +1,9 @@
 Source: libfinance-bank-ie-permanenttsb-perl
 Section: perl
 Priority: optional
-Build-Depends: debhelper (>= 7), quilt
-Build-Depends-Indep: perl (>= 5.6.0-12)
+Build-Depends: debhelper (>= 7)
+Build-Depends-Indep: perl (>= 5.6.0-12), libtest-mockobject-perl, libwww-mechanize-perl,
+ libdate-calc-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Antonio Radici <antonio at dyne.org>
 Standards-Version: 3.8.0
@@ -12,7 +13,7 @@
 
 Package: libfinance-bank-ie-permanenttsb-perl
 Architecture: all
-Depends: ${perl:Depends}, ${misc:Depends}
+Depends: ${perl:Depends}, ${misc:Depends}, libwww-mechanize-perl, libdate-calc-perl
 Description: perl interface to the PermanentTSB Open24 homebanking
  Finance::Bank::IE::PermanentTSB provides a set of functions which can be
  used in perl programs to interact with the Open24 homebanking (www.open24.ie)

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/debian/copyright?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/debian/copyright (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/debian/copyright Sun Mar  8 23:07:57 2009
@@ -4,16 +4,6 @@
     http://www.pallotron.net - http://www.vitadiunsysadmin.net
 Upstream-Source: http://search.cpan.org/dist/Finance-Bank-IE-PermanentTSB/
 Upstream-Name: Finance-Bank-IE-PermanentTSB
-
-X-Repackaging-Reasoning:
-  Upstream sources are repackaged to remove several files with unclear
-  licensing/copyright:
-    * t/data/*.html
-    * t/Finance-Bank-IE-PermanentTSB.t
-  Additionally, MANIFEST is trimmed from references to these files.
-  .
-  Repackaging is done via debian/repack.sh and can be replayed using either
-  "debian/rules get-orig-source" or "uscan -f".
 
 Files: *
 Copyright: 2009, Angelo "pallotron" Failla, <pallotron at freaknet.org>
@@ -22,11 +12,6 @@
 
 Files: debian/*
 Copyright: 2009, Antonio Radici <antonio at dyne.org>
-License-Alias: Perl
-License: GPL-1+ | Artistic
-
-Files: debian/repack.sh
-Copyright: 2008, Damyan Ivanov <dmn at debian.org>
 License-Alias: Perl
 License: GPL-1+ | Artistic
 
@@ -43,6 +28,3 @@
     any later version.
     On Debian GNU/Linux systems, the complete text of the GNU General
     Public License can be found in `/usr/share/common-licenses/GPL'
-
-Upstream source is repackaged to get rid of test files  with unclear
-copyright/licensing.

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/debian/rules?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/debian/rules (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/debian/rules Sun Mar  8 23:07:57 2009
@@ -1,13 +1,11 @@
 #!/usr/bin/make -f
 
-include /usr/share/quilt/quilt.make
-
 build: build-stamp
-build-stamp: $(QUILT_STAMPFN)
+build-stamp:
 	dh build
 	touch $@
 
-clean: unpatch
+clean:
 	dh $@
 
 install: install-stamp

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/debian/watch
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/debian/watch?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/debian/watch (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/debian/watch Sun Mar  8 23:07:57 2009
@@ -1,7 +1,5 @@
 # format version number, currently 3; this line is compulsory!
 version=3
 # URL to the package page followed by a regex to search
-opts="dversionmangle=s/\+dfsg\.\d+//" \
 http://search.cpan.org/dist/Finance-Bank-IE-PermanentTSB/ \
-.*/Finance-Bank-IE-PermanentTSB-v?(\d[\d_.-]+)(?:-release)?\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ \
-debian sh debian/repack.sh
+.*/Finance-Bank-IE-PermanentTSB-v?(\d[\d_.-]+)(?:-release)?\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/PermanentTSB.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/PermanentTSB.pm?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/PermanentTSB.pm (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/PermanentTSB.pm Sun Mar  8 23:07:57 2009
@@ -30,7 +30,7 @@
 
 package Finance::Bank::IE::PermanentTSB;
 
-our $VERSION = '0.2';
+our $VERSION = '0.4';
 
 use strict;
 use warnings;
@@ -101,8 +101,6 @@
     );
 
 =head2 C<$boolean = login($config_ref)> - B<private>
-
-=over
 
 B<This is a private function used by other function within the module.
 You don't need to call it directly from you code!>
@@ -117,9 +115,8 @@
 persist on your filesystem until you reboot your machine (and /var/tmp
 get clean at boot time).
 
-=back
-
 =cut
+
 sub login {
     my $self = shift;
     my $config_ref = shift;
@@ -233,10 +230,12 @@
                 "this 3 times in a row or you account will be locked!");
             return undef;
         }
+        print $content if($config_ref->{debug});
         set_pan_fields($agent, $config_ref);
         $res = $agent->submit();
         $agent->save_content("./step2_pan_result.html") 
             if $config_ref->{debug};
+        print $content if($config_ref->{debug});
     }
 
     return 1;
@@ -244,8 +243,6 @@
 }
 
 =head2 C<set_pan_fields($config_ref)> - B<private>
-
-=over
 
 B<This is a private function used by other function within the module.
 You don't need to call it directly from you code!>
@@ -269,8 +266,6 @@
 The function will fill out the form providing 2,3,4 respectively.
 
 This function doesn't return anything.
-
-=back
 
 =cut
 
@@ -308,8 +303,6 @@
 
 =head2 C<@accounts_balance = check_balance($config_ref)> - B<public>
 
-=over
-
 This function require the configuration hash reference as argument.
 It returns an reference to an array of hashes, one hash for each account. 
 In case of error it return undef;
@@ -318,7 +311,7 @@
 =over
 
 =item * 'accname': account name, i.e. "Switch Current A/C".
-    
+
 =item * 'accno': account number. An integer representing the last 4 digits of the
 account.
 
@@ -352,8 +345,6 @@
         );
     }
 
-=back
-
 =cut
 
 sub check_balance {
@@ -367,8 +358,6 @@
  
     $self->login($config_ref) or return undef;
 
-    $res = $agent->get($BASEURL . '/online/Account.aspx');
-    print $agent->content if($config_ref->{debug});
     my $p = HTML::TokeParser->new(\$agent->content());
     my $i = 0;
     my @array;
@@ -406,8 +395,6 @@
 =head2 C<@account_statement = account_statement($config_ref, $acc_type,
 $acc_no, $from, $to, [$type])> - B<public>
 
-=over
-
 This function requires 4 mandatory arguments, the 5th is optional.
 
 =over
@@ -441,8 +428,6 @@
     }
 
 Undef is returned in case of error;
-
-=back
 
 =cut
 
@@ -741,17 +726,13 @@
 
 =head1 MODULE HOMEPAGES
 
+=over
+
 =item * Project homepage on Google code (with SVN repository):
 
-=over
-
 L<http://code.google.com/p/finance-bank-ie-permanenttsb>
 
-=back
-
 =item * Project homepage on CPAN.org:
-
-=over
 
 L<http://search.cpan.org/~pallotron/Finance-Bank-IE-PermanentTSB/>
 

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/templates/gnuplot_print.gp
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/templates/gnuplot_print.gp?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/templates/gnuplot_print.gp (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/lib/Finance/Bank/IE/templates/gnuplot_print.gp Sun Mar  8 23:07:57 2009
@@ -18,4 +18,8 @@
 
 set terminal wxt
 replot
+
+set terminal dumb
+replot
+
 pause -1 "Hit return to exit"

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/lib/ptsb_util.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/lib/ptsb_util.pm?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/lib/ptsb_util.pm (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/lib/ptsb_util.pm Sun Mar  8 23:07:57 2009
@@ -2,7 +2,7 @@
 
 =head1 NAME
 
-ptsb_util
+ptsb_util - functions used by the Finance::Bank::IE::PermanentTSB CLI
 
 This is a package which contains a set of functions used by the CLI utility.
 
@@ -134,6 +134,7 @@
         "expr|e=s" => \$cf->{'expr'},
         "i|image=s" => \$cf->{'image'},
         "g|graph" => \$cf->{'graph'},
+        "o|output=s" => \$cf->{'csv'},
     ) or $error = 1;
 
     usage if($error or $cf->{'help'});
@@ -175,7 +176,6 @@
                 exit -1;
             }
         }
-        
     }
 
     if(defined $cf->{acc_type}) {
@@ -293,7 +293,12 @@
         $cf->{todate});
 
 
-    if(not defined $balance) {
+    if(defined $balance->[0]->{accno}) {
+        if($balance->[0]->{accno} eq '') {
+            print "Error while retrieving the content...\n";
+            return;
+        }
+    } else {
         exit -1;
     }
 
@@ -328,6 +333,7 @@
     my $gnuplot_tmpfile;
 
     my $error = 0;
+    my $csv = 0;
 
     my %config = (
         "open24numba" => $cf->{open24_num},
@@ -346,10 +352,19 @@
     );
 
     if(not defined $statement) {
-        exit -1;
+        return;
     }
 
     print STDERR Dumper(\$statement) if($cf->{debug});
+
+    if(defined $cf->{csv}) {
+        if(open(CSV, ">".$cf->{csv})) {
+            $csv = 1;
+        } else {
+            print STDERR "Error opening file ".$cf->{csv}.": $!\n";
+            $csv = 0;
+        }
+    }
 
     print_statement_header($cf->{no_balance});
 
@@ -442,9 +457,17 @@
             } else {
                 $counter_deposit += $row->{euro_amount};
             }
-        }
-
-    }
+            if($csv) {
+                printf CSV "%s,%s,%s", $row->{date}, $row->{description},
+                    $row->{euro_amount};
+                print CSV ",", $row->{balance} if(not $cf->{no_balance});
+                print CSV "\n";
+            }
+        }
+
+    }
+
+    close CSV if ($csv);
 
     $gnuplot_tmpfile .=
         $statement->[$#$statement]->{date}."\t".

Modified: trunk/libfinance-bank-ie-permanenttsb-perl/ptsb
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libfinance-bank-ie-permanenttsb-perl/ptsb?rev=31749&op=diff
==============================================================================
--- trunk/libfinance-bank-ie-permanenttsb-perl/ptsb (original)
+++ trunk/libfinance-bank-ie-permanenttsb-perl/ptsb Sun Mar  8 23:07:57 2009
@@ -48,7 +48,7 @@
 
 =head1 NAME
 
-ptsb - Interact with you Permanent TSB homebanking!
+ptsb - Interact with you Permanent TSB homebanking from your shell!
 
 =head1 SYNOPSIS
 
@@ -56,20 +56,26 @@
 
 =head2 Print accounts balance:
 
-=over 2
-
-ptsb [ -F F</path/of/conf/file> ] -b
+=over
+
+=item C<ptsb [ -F F</path/of/conf/file> ] -b>
 
 =back
 
 =head2 Print account statement:
 
-=over 2
-
-ptsb [ -F F</path/of/conf/file> ] -s -a c -n <4digits>
-       -f yyyy/mm/dd  -t yyyy/mm/dd
-
-=back
+=over
+
+=item C<ptsb [ -F F</path/of/conf/file> ] -s -a c -n <4digits> -f yyyy/mm/dd  -t yyyy/mm/dd>
+
+=back
+
+If your are running Linux you can use the F<date --date> command to simplify the date range definition.
+You can put these aliases on your F<~/.bashrc>:
+
+    alias ptsb_stat='ptsb --statement -a c -n xyzt'
+    alias ptst_last_month="statement_current -f `date +%Y/%m/%d --date='1 month ago'` -t `date +%Y/%m/%d`"
+
 
 =head1 OPTIONS
 
@@ -90,7 +96,7 @@
 Please refer to manual page to see how this file is built.
 
 =item B<-b | --balance>
-                     
+
 print account balance
 
 =item B<-s | --statement>
@@ -147,6 +153,15 @@
 =item B<-i F<path> | --image F<path>>
 
 Save PNG image in path.
+
+=item B<-o F<filename> | --output F<filename>>
+
+Save the output of the statement inside a CSV file named F<filename>.
+CSV format is:
+
+date,description,amount,balance
+
+last field presence depends on the -N flag.
 
 =item B<-v | --version>
 
@@ -185,6 +200,8 @@
 
 =head1 SEE ALSO
 
+=over
+
 =item * B<Official CPAN page for Finance::Bank::IE::PermanentTSB>
 
 L<http://search.cpan.org/~pallotron/Finance-Bank-IE-PermanentTSB/lib/Finance/Bank/IE/PermanentTSB.pm>
@@ -200,6 +217,8 @@
 =item * B<Author homepage on CPAN>
 
 L<http://search.cpan.org/~pallotron/>
+
+=back
 
 =head1 AUTHOR
 




More information about the Pkg-perl-cvs-commits mailing list