--- /dev/null
+#!/usr/bin/python
+
+import os
+import re
+import argparse
+import string
+import shutil
+
+parser = argparse.ArgumentParser(description="Copy presskits from press repo to pgweb repo")
+
+parser.add_argument('--pressdir', default=".")
+parser.add_argument('--pgweb', default='/home/josh/git/pgweb')
+parser.add_argument('--release', default='9.3')
+args = parser.parse_args()
+
+pgwebdir = args.pgweb + '/templates/pages/about/press/presskit' + string.replace(args.release,'.','')
+pkitname = 'presskit' + string.replace(args.release,'.','') + '.html'
+
+for root, dirs, files in os.walk(args.pressdir):
+ print root
+ redir = re.search(r'/(\w{2}(_\w{2})?)$', root, re.UNICODE | re.I)
+ if not redir:
+ continue
+
+ dgrp = redir.groups()
+ langd = dgrp[0]
+ if pkitname in files:
+ shutil.copyfile(root + '/' + pkitname, pgwebdir + '/' + langd + '.html')
+ print langd
+
+
+
+
+
+
+
+
--- /dev/null
+#!/usr/bin/perl -w
+#use strict;
+
+use DBI ;
+my $user = "josh" ;
+my $passwd = "" ;
+
+my $pdbh = DBI->connect("dbi:Pg:dbname=contacts host=127.0.0.1 port=5432", $user, $passwd);
+
+$action = $pdbh->prepare("SELECT name, pgemail, office_phone, cell_phone, xtra_line, UPPER(continent) as con, region,
+ url FROM contacts WHERE verified ORDER BY continent, region, name;") ;
+$action->execute() ;
+$action->bind_columns( undef, \$name, \$pgemail, \$office, \$cell, \$xtra, \$continent, \$region, \$url );
+
+
+open (CONTACTS, ">", $ARGV[0]) ;
+print CONTACTS "List As Of: ". `date`;
+
+
+my $last_region;
+my $last_continent;
+
+while ( $action->fetch ) {
+ if ( $continent ne $last_continent ) {
+ print CONTACTS "\n$continent\n";
+ $last_continent = $continent;
+ }
+ if ( $region ne $last_region ) {
+ print CONTACTS "$region\n";
+ $last_region = $region;
+ }
+ print CONTACTS "$name\n";
+ print CONTACTS "$pgemail\n";
+ $office and print CONTACTS "Phone: $office\n";
+ $cell and print CONTACTS "Cell: $cell\n";
+ $url and print CONTACTS "$url\n";
+ $xtra and print CONTACTS "$xtra\n";
+ print CONTACTS "\n";
+}
+
+$pdbh->disconnect;
+close CONTACTS;
+
+exit(0);
--- /dev/null
+#!/usr/bin/perl -w
+#use strict;
+
+use DBI ;
+my $user = "josh" ;
+my $passwd = "" ;
+
+my $pdbh = DBI->connect("dbi:Pg:dbname=contacts host=127.0.0.1", $user, $passwd);
+
+$action = $pdbh->prepare("SELECT name, pgemail, office_phone, cell_phone, xtra_line, continent as con, region,
+ url FROM contacts WHERE verified ORDER BY continent, region, name;") ;
+$action->execute() ;
+$action->bind_columns( undef, \$name, \$pgemail, \$office, \$cell, \$xtra_line, \$continent, \$region, \$url );
+
+
+open CONTACTS, ">contact.html";
+print CONTACTS '{%extends "base/page.html"%}
+{%block title%}PostgreSQL Regional Contacts{%endblock%}
+{%block contents%}
+
+<div id="pgPressContacts">
+<h1>Press Contacts</h1>
+
+<p>Please refer to the list of country contacts below for press enquiries.</p>
+<p>For general press enquiries in English, see <a href="#USA">USA & General Enquiries</a>.</p>';
+print CONTACTS "\n";
+
+my $last_region;
+my $last_continent;
+
+while ( $action->fetch ) {
+ if ( $continent ne $last_continent ) {
+ if ( defined $last_continent ) {
+ print CONTACTS "</dl>\n";
+ }
+ print CONTACTS "\n<h2>$continent</h2>\n";
+ print CONTACTS "<dl>\n";
+ $last_continent = $continent;
+ }
+
+ if ( $region ne $last_region ) {
+ print CONTACTS "<dt>";
+ if ( $region =~ "USA" ) {
+ print CONTACTS "<a name=\"USA\"></a>";
+ }
+ print CONTACTS "$region</dt>\n";
+ $last_region = $region;
+ }
+ print CONTACTS "<dd>$name\n";
+ print CONTACTS "<br /><a href=\"mailto:$pgemail\">$pgemail</a>\n";
+ $office and print CONTACTS "<br />Phone: $office\n";
+ $cell and print CONTACTS "<br />Cell: $cell\n";
+ $xtra_line and print CONTACTS "<br />$xtra_line\n";
+ $url and print CONTACTS "<br /><a href=\"$url\">$url</a>\n";
+ print CONTACTS "</dd>\n";
+}
+
+print CONTACTS "</dl>\n</div>\n";
+
+print CONTACTS "{%endblock%}\n";
+
+$pdbh->disconnect;
+close CONTACTS;
+
+exit(0);