aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emptyhomes/canonicalise-eha80
-rwxr-xr-xbin/emptyhomes/make_welsh_po116
-rwxr-xr-xbin/gettext-extract3
-rwxr-xr-xbin/gettext-merge5
-rwxr-xr-xbin/install-as-user2
-rwxr-xr-xbin/problem-creation-graph1
-rwxr-xr-xbin/update-all-reports8
7 files changed, 0 insertions, 215 deletions
diff --git a/bin/emptyhomes/canonicalise-eha b/bin/emptyhomes/canonicalise-eha
deleted file mode 100755
index 1030982fa..000000000
--- a/bin/emptyhomes/canonicalise-eha
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/perl -w
-
-# canonicalise-eha:
-# Convert provided TSV file into one with standard names for MaPit
-#
-# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
-# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
-#
-# $Id: canonicalise-eha,v 1.1 2009-05-27 11:11:18 matthew Exp $
-
-use strict;
-require 5.8.0;
-
-# Horrible boilerplate to set up appropriate library paths.
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
-use mySociety::Config;
-use mySociety::MaPit;
-use mySociety::VotingArea;
-
-BEGIN {
- mySociety::Config::set_file("$FindBin::Bin/../conf/general");
- mySociety::MaPit::configure();
-}
-
-my %councils;
-open(FP, "$FindBin::Bin/../data/eha_listN");
-while (<FP>) {
- s/\r?\n//g;
- my ($name, $email) = split /\s*\t+\s*/;
- $email ||= '';
- #$name = 'Blackburn' if $name eq 'Blackburn with Darwen';
- $name =~ s/^St /St. /;
- $name =~ s/-(upon|on|le)-/ $1 /;
- $name =~ s/^LB //;
- $name =~ s/ BC| DC| MDC| MBC| (Metropolitan|Borough|District|County|City) Council| Council//;
- print "Already have $name\n" if $councils{$name};
- $councils{$name} = $email;
-}
-close(FP);
-
-my @types = grep { $_ !~ /CTY|LGD/ } @$mySociety::VotingArea::council_parent_types;
-my (%out);
-foreach my $type (@types) {
- my $areas = mySociety::MaPit::get_areas_by_type($type);
- my $areas_info = mySociety::MaPit::get_voting_areas_info($areas);
- foreach my $id (keys %$areas_info) {
- my $area_info = $areas_info->{$id};
- next if $area_info->{country} eq 'S';
- my $name = $area_info->{name};
- if ($name eq 'Durham City Council') {
- $out{$id} = $councils{'Durham City'};
- delete $councils{'Durham City'};
- next;
- #} elsif ($name eq 'Durham County Council') {
- # $out{$id} = $councils{'Durham County'};
- # next;
- }
- $name =~ s/( (Borough|City|District|County))* Council//;
- if ($councils{$name} && $councils{$name} =~ /@/) {
- $out{$id} = $councils{$name};
- delete $councils{$name};
- } else {
- print "Problem: $name $area_info->{country}\n";
- }
- }
-}
-
-foreach (sort keys %councils) {
- print "Not matched: $_ $councils{$_}\n";
-}
-
-# Output emails to canonical CSV
-open(FP, ">$FindBin::Bin/../data/eha.csv");
-foreach (sort keys %out) {
- print FP "$_," . $out{$_} . "\n";
-}
-close FP;
diff --git a/bin/emptyhomes/make_welsh_po b/bin/emptyhomes/make_welsh_po
deleted file mode 100755
index 568ccdcde..000000000
--- a/bin/emptyhomes/make_welsh_po
+++ /dev/null
@@ -1,116 +0,0 @@
-#!/usr/bin/env perl
-
-use strict;
-use warnings;
-
-# Given a translation of the Empty Homes version of the FixMyStreet .po file,
-# fix it all up to go direct from FixMyStreet -> EH translation.
-
-use POSIX;
-use FindBin;
-use lib "$FindBin::Bin/../../perllib";
-use PoChange;
-
-chdir("$FindBin::Bin/../../locale");
-
-# First read in translation and match up.
-open(INPO, 'cy_GB.UTF-8/LC_MESSAGES/EmptyHomes.po') or die $!;
-
-my $state = 'start';
-my $msgid = '';
-my $fuzzy = 0;
-my $msgstr;
-my %lookup;
-while (<INPO>) {
- if (m/^#, fuzzy/) {
- $fuzzy = 1;
- } elsif (m/^#/) {
- # comment or blank line
- } elsif (m/^\s+$/) {
- # blank line separates translations
- $msgid =~ s/"\n"//g;
- $lookup{$msgid} = [ $msgstr, $fuzzy ];
- $state = 'msgid';
- $msgid = "";
- $fuzzy = 0;
- } elsif ($state eq 'msgid' && (m/^msgstr "/ || m/^msgstr\[0\] "/)) {
- $msgstr = $_;
- $state = 'msgstr';
- } elsif ($state eq 'msgstr') {
- $msgstr .= $_;
- } elsif ($state eq 'msgid') {
- $msgid .= $_;
- }
-}
-$lookup{$msgid} = [ $msgstr, $fuzzy ];
-close INPO;
-
-mkdir("en_GB.UTF-8");
-mkdir("en_GB.UTF-8/LC_MESSAGES");
-mkdir("cy_GB.UTF-8");
-mkdir("cy_GB.UTF-8/LC_MESSAGES");
-
-open(MAINPO, 'FixMyStreet.po') or die;
-open(OUTPO, ">cy_GB.UTF-8/LC_MESSAGES/FixMyStreet-EmptyHomes.po") or die;
-
-print OUTPO "# AUTOMATICALLY GENERATED by make_welsh_po, do not edit\n\n";
-
-my $buffer = "";
-my $start = 0;
-while(<MAINPO>) {
- if (!$start) {
- s/#, fuzzy/#/;
- }
- if (m/"Last-Translator: FULL NAME/) {
- $_ = '"Last-Translator: mysociety/bin/emptyhomes/make_welsh_po\\n"'."\n";
- }
- if (m/"PO-Revision-Date: YEAR-MO-DA/) {
- my $time = POSIX::strftime("%Y-%m-%d %H:%M%z", localtime(time()));
- $_ = '"PO-Revision-Date: '.$time.'\\n"'."\n";
- }
- if (m/"Language-Team: LANGUAGE/) {
- $_ = '"Language-Team: mySociety\\n"'."\n";
- }
- if (m/"Plural-Forms: nplurals=/) {
- $_ = '"Plural-Forms: nplurals=2; plural=n != 1;\\n"'."\n";
- }
-
- if (m/^#/) {
- # comment or blank line
- print OUTPO $_;
- } elsif (m/^\s+$/) {
- # blank line
- $start = 1;
- $buffer = "";
- print OUTPO $_;
- } elsif ($start && (m/^msgstr "/ || m/^msgstr\[0\] "/)) {
- # start of translated text - translate English into Empty Homes language
- my $new_buffer = PoChange::fixmystreet_to_reportemptyhomes($buffer);
- $new_buffer =~ s/"\n"//g;
-
- if ($lookup{$new_buffer} && $lookup{$new_buffer}[1]) {
- print OUTPO "#, fuzzy\n";
- }
-
- print OUTPO $buffer;
- if ($lookup{$new_buffer}) {
- print OUTPO $lookup{$new_buffer}[0];
- } else {
- if (m/^msgstr\[0\] ""/) {
- $new_buffer =~ s/^msgid "/msgstr[0] "/m;
- $new_buffer =~ s/^msgid_plural "/msgstr[1] "/m;
- $_ = <MAINPO>; # skip untranslated plural
- } else {
- $new_buffer =~ s/^msgid "/msgstr "/;
- }
- print OUTPO $new_buffer;
- }
-
- $buffer = "";
- } elsif (!$start) {
- print OUTPO $_;
- } else {
- $buffer .= $_;
- }
-}
-
diff --git a/bin/gettext-extract b/bin/gettext-extract
index ca37e9d6d..694fba66e 100755
--- a/bin/gettext-extract
+++ b/bin/gettext-extract
@@ -34,6 +34,3 @@ bin/update_po_header.bash $PO
echo "$( bin/gettext-nget-patch )" >> $PO
-#bin/make_po FixMyStreet-EmptyHomes
-#bin/make_po FixMyBarangay
-
diff --git a/bin/gettext-merge b/bin/gettext-merge
index b84708ece..373b39b31 100755
--- a/bin/gettext-merge
+++ b/bin/gettext-merge
@@ -14,11 +14,6 @@ do
then
cd $X/LC_MESSAGES
echo $X
- if [ -e EmptyHomes.po ]
- then
- msgmerge --no-wrap -o New.po EmptyHomes.po ../../FixMyStreet-EmptyHomes.po
- mv New.po EmptyHomes.po
- fi
if [ -e FixMyStreet.po ]
then
msgmerge --no-wrap -o New.po FixMyStreet.po ../../FixMyStreet.po
diff --git a/bin/install-as-user b/bin/install-as-user
index 0e1c151fb..297efc1f3 100755
--- a/bin/install-as-user
+++ b/bin/install-as-user
@@ -133,8 +133,6 @@ echo $DONE_MSG
# Generate po and mo files (these invocations taken from Kagee's script):
echo "Creating locale .mo files"
-bin/make_po FixMyStreet-EmptyHomes
-bin/emptyhomes/make_welsh_po
commonlib/bin/gettext-makemo FixMyStreet
echo $DONE_MSG
diff --git a/bin/problem-creation-graph b/bin/problem-creation-graph
index a8554058a..d1fe08fd4 100755
--- a/bin/problem-creation-graph
+++ b/bin/problem-creation-graph
@@ -34,7 +34,6 @@ my %config = (
my $base_url = FixMyStreet->config('BASE_URL');
$config{date} = '2007-02-01';
$config{date} = '2011-03-03' if $base_url =~ /fiksgatami/;
-$config{date} = '2008-10-01' if $base_url =~ /emptyhomes/;
my %sources;
sub grab_data {
diff --git a/bin/update-all-reports b/bin/update-all-reports
index d951756e4..6691ff4f0 100755
--- a/bin/update-all-reports
+++ b/bin/update-all-reports
@@ -81,14 +81,6 @@ while ( my @problem = $problems->next ) {
}
}
-if ( FixMyStreet->config('BASE_URL') =~ /emptyhomes/ ) {
- my $cobrand = FixMyStreet::Cobrand->get_class_for_moniker('emptyhomes')->new();
- my $stats = $cobrand->old_site_stats;
- foreach (keys %$stats) {
- $open{$_}{unknown} += $stats->{$_};
- }
-}
-
my $body = encode_json( {
fixed => \%fixed,
open => \%open,