From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1L3te3-0003r8-J4 for garchives@archives.gentoo.org; Sat, 22 Nov 2008 14:39:35 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7184BE04F9; Sat, 22 Nov 2008 14:39:35 +0000 (UTC) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.187]) by pigeon.gentoo.org (Postfix) with ESMTP id F33BCE04F9 for ; Sat, 22 Nov 2008 14:39:34 +0000 (UTC) Received: by fk-out-0910.google.com with SMTP id 18so1775048fks.2 for ; Sat, 22 Nov 2008 06:39:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:x-enigmail-version:content-type; bh=SEQdylYXixr20m5ljetoLa8N/lLd54H3Ze+UZIPzphY=; b=pQZB2UmrGNWGn+lHPFwTdZwoo7fWEici5MA1jz/ehuf+vRKgw5M8MrQsWdlWc8dww8 YJgn0cKMZ71cdl+nswZ+KwAiYyUbr6Kdq6/RxUP0vcFnjliIy/1W3BPncPJVQzsuEdbb UNBUSm7QHDZd3mgdf27pv8ErBULy7ZAmlxeXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type; b=DsAbiVlE/jD0BLHZBTJdyF3Dtl/qPyKFirEm0yqElox9zBtqeIpfBVXWH5gJCCUaIx 7mNd3REyfcyCNbtbLuesfZFLbYnk8rDFETfxqdoLBvvl/aGnQlixza7fGv6lRdcZHM1O CuP3QpN+EHL/xacdctk4D5UcY+ES/BYAU3RgU= Received: by 10.180.232.16 with SMTP id e16mr440380bkh.77.1227364772540; Sat, 22 Nov 2008 06:39:32 -0800 (PST) Received: from ?2.1.21.43? (85-18-201-162.ip.fastwebnet.it [85.18.201.162]) by mx.google.com with ESMTPS id z10sm183249fka.19.2008.11.22.06.39.30 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 22 Nov 2008 06:39:31 -0800 (PST) Message-ID: <492819A1.60108@gmail.com> Date: Sat, 22 Nov 2008 15:39:29 +0100 From: Marcello Magaldi User-Agent: Thunderbird 2.0.0.17 (X11/20080928) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-docs-it@lists.gentoo.org Reply-to: gentoo-docs-it@lists.gentoo.org MIME-Version: 1.0 To: gentoo-docs-it@lists.gentoo.org Subject: [gentoo-docs-it] parse-trads.pl di Gianni Costanzi : tabella allineata a destra X-Enigmail-Version: 0.95.7 Content-Type: multipart/mixed; boundary="------------070501050501010409050009" X-Archives-Salt: da549662-bba8-43c0-96fc-5937f6fef1be X-Archives-Hash: bd8118a11452a2c0fec099bba321e008 This is a multi-part message in MIME format. --------------070501050501010409050009 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Ciao a tutti, da un po' di tempo a questa parte ho notato che lo script di Gianni Costanzi per estrarre solo le righe che riguardano uno specifico traduttore stampa la tabella tutta allineata a destra invece che a sinistra. Avevo in passato modificato leggermente lo script per accettare tra i parametri di input il nome del traduttore (altrimenti funzionava con Gianni Costanzi) ma comunque non credo proprio che c'entri qualcosa questa mia modifica. Ho notato , analizzando il codice della pagina di scen che in soli due casi vi =E8 un tr allineato a destra , e credo sia quello che fa "impazzire" lo script di Gianni , in particolare queste due righe : = mentre per la seconda occorrenza mi =E8 chiaro il perch=E8 dell'allineame= nto a destra, nella prima occorrenza mi sembra che la riga sia praticamente vuota.... credo che sia appunto la prima occorrenza a causare l'erroneo allineamento del risultato dello script. Io non sono un granch=E8 con il perl e quindi non saprei come fare per sistemare la cosa, vi allego comunque il codice.... Ciao Marcello --------------070501050501010409050009 Content-Type: application/x-perl; name="parse-trads.pl" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="parse-trads.pl" #!/usr/bin/perl -w #Copyright (C) 2007, Gianni Costanzi (gianni.costanzi@gmail.com) #This program 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 version. # #This program is distributed in the hope that it will be useful, #but WITHOUT ANY WARRANTY; without even the implied warranty of #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. # #You should have received a copy of the GNU General Public License #along with this program; if not, write to the Free Software #Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use LWP; use POSIX qw /:sys_wait_h floor/; $OUTPUT_FILE = "$ARGV[1]"; #$OUTPUT_FILE = "/home/gianni/GentooDocs/trads-it.html"; #$AUTHOR_NAME = "Gianni Costanzi"; $AUTHOR_NAME = "$ARGV[0]"; #$URL = "http://dev.gentoo.org/~so/trads-it.html"; #$URL = "http://dev.gentoo.org/~mascherpa/trads-it.xml"; $URL = "http://dev.gentoo.org/~scen/trads-it.html"; sub print_usage { print "\nUsage: parse-trads.pl name output-file[--copyright]\n\n"; } sub cmdline_error { print $_[0] . "\n"; print_usage; exit -1; } sub print_copyright { print <new; $ua->timeout(30); $ua->env_proxy; $| = 1; print "Fetching $URL.."; $response = $ua->get($URL); if ($response->is_success) { print " OK\n"; } else { print "\n"; die $response->status_line; } $response = $response->content; print "Filtering page contents.."; open(OUT,">$OUTPUT_FILE") || die "Unable to create output file!"; $| = 0; while ($response =~ /([^\n]+\n)/g) { $_ = $1; if (// && $first > 0) { while($response =~ /([^\n]+\n)/g) { $_ = $1; print OUT; if (/<\/tr>/) { $first--; last; } } } elsif (//) { $found = 0; $line = $_; while ($response =~ /([^\n]+\n)/g) { $_ = $1; if (/<\/tr>/) { if ($found == 0) { last; } else { $line = $line . " " . $_; print OUT $line; last; } } else { if (/$AUTHOR_NAME/) { $found = 1; } $line = $line . " " . $_; } } } else { print OUT; } } print " OK\n"; print "$OUTPUT_FILE successfully created!\n\n"; --------------070501050501010409050009--
Copyright 2001-2008 Gentoo Foundation, Inc. Questions, Comments? Contact us.