Shortcuts for properties, connpoints patch, potfiles.
[dia.git] / sheets / make-sheet
blobe23104af946a54bc5290f3912ffaec5f0770d788
1 #!/usr/bin/perl -w
3 use strict;
4 use English;
6 my $dir = $ARGV[0];
7 if (!$dir) {
8 $dir = $ENV{"PWD"};
11 $dir =~ /([^\/]*)\/?$/;
12 my $name = $1;
14 print "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?> <!-- -*- xml -*- -->\n";
15 print "\n";
17 print "<sheet xmlns=\"http://www.lysator.liu.se/~alla/dia/dia-sheet-ns\">\n";
19 print " <name>$name</name>\n";
20 print " <description>DESCRIBE $name</description>\n";
22 print " <contents>\n";
24 opendir(DIR, $dir) || die "can't opendir $dir: $!";
25 my @shapes = grep { /\.shape$/ && -f "$dir/$_" } readdir(DIR);
26 closedir DIR;
28 foreach my $shape (@shapes) {
29 $shape =~ s/(.*)\.shape$/$1/;
30 print " <object name=\"$name - $shape\">\n";
31 print " <description>DESCRIBE $shape</description>\n";
32 print " </object>\n";
35 print " </contents>\n";
36 print "</sheet>\n";