Bugzilla – Attachment 39183 Details for
Bug 11368
Add script to import Lexile scores
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11368 [QA Followup]
Bug-11368-QA-Followup.patch (text/plain), 3.41 KB, created by
Kyle M Hall (khall)
on 2015-05-14 12:42:29 UTC
(
hide
)
Description:
Bug 11368 [QA Followup]
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-05-14 12:42:29 UTC
Size:
3.41 KB
patch
obsolete
>From 4bc7b8d3a5ef04195ebb95899bcca9675e5e068e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 14 May 2015 08:21:10 -0400 >Subject: [PATCH] Bug 11368 [QA Followup] > >* Fix QA failures >* Fix copyright >* Add file format documentation >* Add -c --confirm option >* Add -t --test option >* Add -h --help option >--- > misc/migration_tools/import_lexile.pl | 26 +++++++++++++++++++------- > 1 files changed, 19 insertions(+), 7 deletions(-) > >diff --git a/misc/migration_tools/import_lexile.pl b/misc/migration_tools/import_lexile.pl >index 09c9ef2..a81f743 100755 >--- a/misc/migration_tools/import_lexile.pl >+++ b/misc/migration_tools/import_lexile.pl >@@ -1,12 +1,12 @@ > #!/usr/bin/perl > #----------------------------------- >-# Copyright 2013 ByWater Solutions >+# Copyright 2015 ByWater Solutions > # > # This file is part of Koha. > # > # Koha is free software; you can redistribute it and/or modify it under the > # terms of the GNU General Public License as published by the Free Software >-# Foundation; either version 2 of the License, or (at your option) any later >+# Foundation; either version 3 of the License, or (at your option) any later > # version. > # > # Koha is distributed in the hope that it will be useful, but WITHOUT ANY >@@ -36,7 +36,7 @@ use C4::Biblio; > use C4::Koha qw( GetVariationsOfISBN ); > use Koha::Database; > >-binmode STDOUT, ':utf8'; >+binmode STDOUT, ':encoding(UTF-8)'; > > BEGIN { > >@@ -46,6 +46,9 @@ BEGIN { > eval { require "$FindBin::Bin/../kohalib.pl" }; > } > >+my $help; >+my $confirm; >+my $test; > my $file; > my $verbose; > my $start; >@@ -56,6 +59,9 @@ my $subfield_source = "b"; > my $subfield_source_value = "Lexile"; > > GetOptions( >+ 'h|help' => \$help, >+ 'c|confirm' => \$confirm, >+ 't|test' => \$test, > 'f|file=s' => \$file, > 'v|verbose+' => \$verbose, > 's|start=s' => \$start, >@@ -73,16 +79,22 @@ import_lexile.pl -f /path/to/LexileTitles.txt > > This script takes the following parameters : > >- -f | --file CSV file of lexile scores ( acquired from Lexile.com ) >- -v | --verbose Print data on found matches >+ -h --help Display this help >+ -c --confirm Confirms you want to really run this script ( otherwise print help ) >+ -t --test Runs the script in test mode ( no changes will be made to your database ) >+ -f --file CSV file of lexile scores ( acquired from Lexile.com ) >+ -v --verbose Print data on found matches > --field Defines the field number for the Lexile data ( default: 521 ) > --target-audience-note Defines the subfield for the lexile score ( default: a ) > --source Defines the "Source" subfield ( default: b ) > --source-value Defines the value to put stored in the "Source" subfield ( default: "Lexile" ) > >+ The CSV file must have the following columns ( with the first line being the column headers ) in tab delimited format: >+ Title, Author, ISBN, ISBN13, Lexile >+ > ENDUSAGE > >-unless ($file) { >+if ( $help || !$file || !$confirm ) { > say $usage; > exit(1); > } >@@ -188,7 +200,7 @@ while ( my $row = $csv->getline_hr($fh) ) { > $record->append_fields($field); > } > >- ModBiblio( $record, $biblionumber ); >+ ModBiblio( $record, $biblionumber ) unless ( $test ); > } > > } >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11368
:
23379
|
23380
|
28092
|
36438
|
39182
|
39183
|
42603
|
42641
|
42642
|
42643