Update of /cvsroot/pure-data/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14870
Modified Files:
parse-help-patches.pl
Log Message:
script used for Portuguese templates
Index: parse-help-patches.pl
===================================================================
RCS file: /cvsroot/pure-data/scripts/parse-help-patches.pl,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** parse-help-patches.pl 30 Sep 2007 20:51:16 -0000 1.2
--- parse-help-patches.pl 16 Oct 2007 19:50:28 -0000 1.3
***************
*** 17,55 ****
my %xyhash = ();
! my $library = "";
! my $name = "";
my $fileName = "";
- #------------------------------------------------------------------------------#
- # THE OUTPUT FORMAT
- #------------------------------------------------------------------------------#
- format OBJECTCLASS =
-
-
- ==Inlets==
-
! ==Outlets==
!
! ==Arguments==
- ==Messages==
! {{objectclass-stub}}
! [[Category:objectclass]]
! .
#------------------------------------------------------------------------------#
# PARSE CSV
#------------------------------------------------------------------------------#
! my $csvfile = '/Users/hans/Desktop/wiki_files_hacked/objectlist.csv';
my $csv = Text::CSV_PP->new();
my %csvhash = ();
--- 17,113 ----
my %xyhash = ();
! my $libraryName = "";
! my $objectclassName = "";
my $fileName = "";
+ my $pageName = "";
+ my $abbreviationName = "";
+ my $descriptionName = "";
+ my $categoryName = "";
+ my $datatypeName = "";
! #------------------------------------------------------------------------------#
! # TRANSLATION VARIABLES
! #------------------------------------------------------------------------------#
+ # wikipedia terms
+ my $stub = "";
+ my $template = "";
+ my $category = "";
+ my $infobox = "";
+ my $topLevel = ""; #
! # pdpedia terms
! my $objectclass = "";
+ # page headers
+ my $inlets = "";
+ my $outlets = "";
+ my $arguments = "";
+ my $messages = "";
+ # infobox
+ my $name = "";
+ my $description = "";
+ my $abbreviation = "";
+ my $library = "";
+ my $author = "";
+ my $developer = "";
+ my $releaseVersion = "";
+ my $releaseDate = "";
+ my $dependencies = "";
+ my $license = "";
+ my $website = "";
+ my $programmingLanguage = "";
+ my $platform = "";
+ my $operatingSystem = "";
+ my $language = "";
+ my $dataType = "";
+ my $distributions = "";
+ my $status = "";
+ #------------------------------------------------------------------------------#
+ # Portuguese
+ # wikipedia terms
+ $stub = "Esboço";
+ $template = "Template";
+ $category = "Categoria";
+ $infobox = "Infobox";
! # pdpedia terms
! $objectclass = "Classe do objecto";
! # page headers
! $inlets = "Entradas";
! $outlets = "Saídas";
! $arguments = "Argumentos";
! $messages = "Mensagens";
+ # infobox
+ $name = "Nome";
+ $description = "Descrição";
+ $abbreviation = "Abreviatura";
+ $library = "Biblioteca";
+ $author = "Autor";
+ $developer = "Programador";
+ $releaseVersion = "Versão actual";
+ $releaseDate = "Data de lançamento";
+ $dependencies = "Dependências";
+ $license = "Licença";
+ $website = "Website";
+ $programmingLanguage = "Linguagem de programação";
+ $platform = "Plataforma";
+ $operatingSystem = "Sistema operativo";
+ $language = "Linguagem";
+ $dataType = "Tipo de dado";
+ $distributions = "Distribuições";
+ $status = "Estado";
#------------------------------------------------------------------------------#
# PARSE CSV
#------------------------------------------------------------------------------#
! my $csvfile = '/Users/hans/Desktop/TODO/wiki_files_hacked/objectlist.csv';
my $csv = Text::CSV_PP->new();
my %csvhash = ();
***************
*** 73,88 ****
#------------------------------------------------------------------------------#
! foreach (`/sw/bin/find /Users/hans/Desktop/wiki_files_hacked/5.reference/ -type f -name '*.pd'`) {
chop;
$fileName = "";
! if (m|.*/5\.reference/([a-zA-Z0-9_-]+)/(.+)-help\.pd|) {
# print("$1 , $2\t");
! $library = lc($1);
! $name = $2;
! $fileName = $_;
! } elsif (m|.*/5\.reference/([a-zA-Z0-9_-]+)/(.+)\.pd|) {
! # print("$1 , $2 (no -help)\t");
! $library = lc($1);
! $name = $2;
$fileName = $_;
}
--- 131,142 ----
#------------------------------------------------------------------------------#
! foreach (`/sw/bin/find /Users/hans/Desktop/TODO/wiki_files_hacked/5.reference/ -type f -name '*.pd'`) {
chop;
$fileName = "";
! if( (m|.*/5\.reference/([a-zA-Z0-9_-]+)/(.+)-help\.pd|) || (m|.*/5\.reference/([a-zA-Z0-9_-]+)/(.+)\.pd|) ) {
# print("$1 , $2\t");
! if( $1 eq 'zflatspace' ) { $libraryName = "flatspace";}
! else {$libraryName = lc($1); }
! $objectclassName = $2;
$fileName = $_;
}
***************
*** 105,109 ****
@lines = split(';\n', $_);
-
foreach (@lines) {
if (m|^#X text ([0-9]+) ([0-9]+) (.*)|) {
--- 159,162 ----
***************
*** 113,117 ****
$lineCount++;
}
-
for ($column = -300; $column < 1501; $column += 300) {
foreach my $yKey ( sort {$a <=> $b} keys(%xyhash) ) {
--- 166,169 ----
***************
*** 126,179 ****
}
! my $abbreviation = "";
! my $description = "";
! my $category = "";
! my $datatype = "";
! my $myColumns = $csvhash{$library}{$name};
my @myColumns;
if($myColumns) { @myColumns = split(',', $myColumns); }
! # print("csvhash{$library}{$name}: $csvhash{$library}{$name}\n");
! if($myColumns[0]) {
! if($myColumns[2]) { $abbreviation = $myColumns[2] }
! if($myColumns[3]) { $description = $myColumns[3] }
! if($myColumns[4]) { $category = $myColumns[4] }
! if($myColumns[5]) { $datatype = $myColumns[5] }
! # print("MYCOLUMNS: $myColumns[0] $myColumns[1] $myColumns[2] $myColumns[3] $myColumns[4] $myColumns[5]\n");
}
! mkdir($library);
! if( $classnames{$name} ) {
! open(OBJECTCLASS, ">$library/${name}_(${library}).txt");
} else {
! open(OBJECTCLASS, ">$library/${name}.txt");
}
! print(OBJECTCLASS "{{Infobox Objectclass\n");
! print(OBJECTCLASS "| name = $name\n");
! if($abbreviation) {
! print(OBJECTCLASS "| abbreviation = $abbreviation\n");}
! if($description) {
! print(OBJECTCLASS "| description = $description\n");}
! if($datatype) {
! print(OBJECTCLASS "| data type = $datatype\n");}
! print(OBJECTCLASS "| library = [[$library]]\n");
! print(OBJECTCLASS "| author = {{$library author}}\n");
! print(OBJECTCLASS "| license = {{$library license}}\n");
! print(OBJECTCLASS "| status = {{$library status}}\n");
! print(OBJECTCLASS "| website = {{$library website}}\n");
! print(OBJECTCLASS "| release date = {{$library release date}}\n");
! print(OBJECTCLASS "| distributions = {{$library distributions}}\n");
! print(OBJECTCLASS "| language = English\n");
! print(OBJECTCLASS "| platform = [[GNU/Linux]], [[Mac OS X]], [[Windows]]\n");
print(OBJECTCLASS "}}\n\n");
! print(OBJECTCLASS "\n$printText\n");
! write(OBJECTCLASS);
! print(OBJECTCLASS "[[Category:$library]]\n");
! if($category) {
! print(OBJECTCLASS "[[Category:$category]]\n");
! }
print(OBJECTCLASS "\n\n");
close(OBJECTCLASS);
! $classnames{$name} = 1;
}
}
--- 178,231 ----
}
! my $myColumns = $csvhash{$libraryName}{$objectclassName};
my @myColumns;
if($myColumns) { @myColumns = split(',', $myColumns); }
! if($myColumns[2]) { $abbreviationName = $myColumns[2]; } if( $classnames{$objectclassName} ) {
! $pageName = "${objectclassName}_(${libraryName})";
! } else {
! $pageName = "${objectclassName}";
}
+
! mkdir($libraryName);
! if( $classnames{$objectclassName} ) {
! $pageName = "${objectclassName}_(${libraryName})";
} else {
! $pageName = "${objectclassName}";
}
! open(OBJECTCLASS, ">$libraryName/${pageName}.txt");
! print(OBJECTCLASS "{{Infobox $objectclass\n");
! print(OBJECTCLASS "| $name = $objectclassName\n");
! if($abbreviationName) {
! print(OBJECTCLASS "| $abbreviation = $abbreviationName\n");}
! print(OBJECTCLASS "| $description = \n");
! print(OBJECTCLASS "| $dataType = \n");
! print(OBJECTCLASS "| $library = [[$libraryName]]\n");
! print(OBJECTCLASS "| $author = {{$libraryName " . lc(${author}) . "}}\n");
! print(OBJECTCLASS "| $license = {{$libraryName " . lc(${license}) . "}}\n");
! print(OBJECTCLASS "| $status = {{$libraryName " . lc(${status}) . "}}\n");
! print(OBJECTCLASS "| $website = {{$libraryName " . lc(${website}) . "}}\n");
! print(OBJECTCLASS "| $releaseVersion = {{$libraryName " . lc(${releaseVersion}) . "}}\n");
! print(OBJECTCLASS "| $releaseDate = {{$libraryName " . lc(${releaseDate}) . "}}\n");
! print(OBJECTCLASS "| $distributions = {{$libraryName " . lc(${distributions}) . "}}\n");
! print(OBJECTCLASS "| $platform = [[GNU/Linux]], [[Mac OS X]], [[Windows]]\n");
print(OBJECTCLASS "}}\n\n");
! # print(OBJECTCLASS "\n$printText\n\n\n");
! print(OBJECTCLASS "==$inlets==\n\n\n");
! print(OBJECTCLASS "==$outlets==\n\n\n");
! print(OBJECTCLASS "==$arguments==\n\n\n");
! print(OBJECTCLASS "==$messages==\n\n\n");
! print(OBJECTCLASS "{{${objectclass}-${stub}}} \n\n");
! print(OBJECTCLASS "[[$category:$objectclass]]\n");
! print(OBJECTCLASS "[[$category:$libraryName]]\n");
! # if($category) {
! # print(OBJECTCLASS "[[$category:$categoryName]]\n");
! # }
! print(OBJECTCLASS "\n\n");
! print(OBJECTCLASS "[[en:$pageName]]\n");
print(OBJECTCLASS "\n\n");
close(OBJECTCLASS);
! $classnames{$objectclassName} = 1;
}
}