Skip to content
Snippets Groups Projects
Commit 9a83f9fb authored by Gerhard Gonter's avatar Gerhard Gonter :speech_balloon:
Browse files

use encode_json() instead of to_json() to write authority control json file; some indenting

parent a0419aba
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,10 @@ use Data::Dumper;
$Data::Dumper::Indent= 1;
use FileHandle;
binmode( STDOUT, ':utf8' ); autoflush STDOUT 1;
binmode( STDERR, ':utf8' ); autoflush STDERR 1;
binmode( STDIN, ':utf8' );
use lib 'lib';
use WikiData::Utils;
use WikiData::Property::Filter;
......@@ -24,7 +28,7 @@ my $exp_bitmap= 0; # 1..does not work; 2..makes no sense, too sparsely populated
# not used my $LR_max_propid= 1930; # dump from 20150608
my $seq= 'a';
my $date= '2016-12-12'; # maybe a config file should be used to set up the defaults...
my $date= '2016-12-19'; # maybe a config file should be used to set up the defaults...
my ($fnm, $data_dir, $out_dir)= WikiData::Utils::get_paths ($date, $seq);
my $upd_paths= 0;
......@@ -286,7 +290,7 @@ my $fnm_authctrl= $data_dir . '/authctrl.json';
local *FO_AUTHCTRL;
open (FO_AUTHCTRL, '>:utf8', $fnm_authctrl) or die "can't write to [$fnm_authctrl]";
autoflush FO_AUTHCTRL 1;
# autoflush FO_AUTHCTRL 1;
print FO_AUTHCTRL "[\n";
my $cnt_authctrl= 0;
......@@ -530,7 +534,7 @@ LINE: while ($running)
if (defined ($authctrl))
{
print FO_AUTHCTRL ",\n" if ($cnt_authctrl);
print FO_AUTHCTRL to_json($authctrl);
print FO_AUTHCTRL encode_json($authctrl);
$cnt_authctrl++;
print "$cnt_authctrl authority control records\n" if (($cnt_authctrl % 1000) == 0);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment