summaryrefslogtreecommitdiffstats
path: root/Zwiffer.pl
blob: bf71add3ade2360bea09416f4a55225e650137df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl

use strict;

open(wizi, "< $ARGV[0]");
open(wizo, "> $ARGV[1]");
my @tab;
my $verbose = 0;

while (<wizi>)
{
    if (/(\s*defaultImage=\".*)\..*\"/) {
	print wizo "$1\"\n";
	next;
    }
    if (/\s*guiType\s*\=.*/ || /\s*font.*\=.*/ || /\s*inputType\s*\=.*/ || /\s*dbPositions\s*\=.*/ ||
	/\s*ratio\s*\=.*/ || /\s*proportional\s*\=.*/ || /\s*length\s*\=.*/ || /\s*alignement\s*\=.*/ ||
	/\s*hasDb\s*\=.*/ || /\s*key\s*\=.*/ || /\s*db.*\=.*/ || /\s*reference.*\=.*/ || /\s*height\s*\=.*/ ||
	/\s*width\s*\=.*/ || /\s*persistent\s*\=.*/) {
	print "# $_" if $verbose;
	next;
    }
    if (m/^\s*<Info/s.../^\s*<\/Info>/m ) {
	if (!/\s*name\s*\=\".*\"\s*/) {
	    push @tab, $_;
	    print ">> $_" if $verbose;
	}
	next;
    }
    else {
	if (@tab > 3) {
	    foreach (@tab) {
		print "?? $_" if $verbose;
		print wizo $_;
	    }
	}
    }
    @tab = ();
    print wizo $_;
}
close(wizi);
close(wizo);
print "$ARGV[0] -> $ARGV[1]\n";