[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[3462] trunk/LedgerSMB/Assets/CSV.pm
- Subject: SF.net SVN: ledger-smb:[3462] trunk/LedgerSMB/Assets/CSV.pm
- From: ..hidden..
- Date: Thu, 07 Jul 2011 14:03:06 +0000
Revision: 3462
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3462&view=rev
Author: einhverfr
Date: 2011-07-07 14:03:05 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
Removing unused CSV module (CSV parsing done in main module)
Removed Paths:
-------------
trunk/LedgerSMB/Assets/CSV.pm
Deleted: trunk/LedgerSMB/Assets/CSV.pm
===================================================================
--- trunk/LedgerSMB/Assets/CSV.pm 2011-07-07 13:58:44 UTC (rev 3461)
+++ trunk/LedgerSMB/Assets/CSV.pm 2011-07-07 14:03:05 UTC (rev 3462)
@@ -1,51 +0,0 @@
-# CSV parser is basically a framework to handle any CSV files or fixed-width format files.
-# Parsers are defined in CSV/parser_type.
-
-package LedgerSMB::Reconciliation::CSV;
-
-use base qw/LedgerSMB::DBObject::Reconciliation/;
-
-opendir (DCSV, 'LedgerSMB/Reconciliation/CSV/Formats');
-for my $format (readdir(DCSV)){
- if ($format !~ /^\./){
- do "LedgerSMB/Reconciliation/CSV/Formats/$format";
- }
-};
-
-sub load_file {
-
- my $self = shift @_;
- my $fieldname = shift @_;
-
- my $contents;
- my $handle = $self->{_request}->upload($fieldname);
- $contents = join("\n", <$handle>);
- return $contents;
-}
-
-sub process {
- my $self = shift @_;
-
- # thoroughly implementation-dependent, so depends on helper-functions
- my ($recon, $fldname) = @_;
- my $contents = $self->load_file($fldname);
-
- my $func = "parse_" . $recon->{chart_id};
- if ($self->can($func)){
- @entries = $self->can($func)->($self,$contents);
- @{$self->{entries}} = @entries;
-
- $self->{file_upload} = 1;
- }
- else {
- $self->{file_upload} = 0;
- }
- return $self->{entries};
-}
-
-sub is_error {
- my $self = shift @_;
- return $self->{invalid_format};
-}
-
-1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.