Appended is a short Perl script that takes a hack at converting edd/dm adl
files into medm adl files. It isn't perfect, but it generally does an
acceptable job. It handles obvious things like the row and column order
interpretation is different, and changes a few names where they don't
apply. You have to make sure you do the global template file first, if you
use that sort of thing.
Some things in edd/dm don't have a corresponding counterpart in medm, so
it is difficult to convert perfectly. I see this as more of a work in
progress than anything else - it may not work for widgets we don't use,
for example. However, at JAC we use it - I installed it and changed the
edd/dm make rule so that it installed both an edd/dm *.dl file and an medm
*.adl file so you can run up either display manager. Ths helps me out
since edd/dm crashes my PC X server, for example.
However - this is not the edd to edm converter people want. On the the
hand, someone mentioned edm supporting an medm input format, and surely a
similar translator that goes straight to the edm format is not too
dificult for a good Perl hacker.
Cheers,
--
Nick Rees
Joint Astronomy Centre Ph: +1 (808) 961-3756
660 N. Aohoku Place Fax: +1 (808) 961-6516
Hilo, HI. 96720 Internet: [email protected]
#!/usr/bin/perl
use strict;
#use warnings;
my @states;
my $state;
my $index;
while ( my $line = <STDIN> ) {
# Check to see if we are at the beginning of a block
if ( $line =~ /^\s*"?([^\["]+)\[?([0-9]*)[\]"]*\s*{/ ) {
push( @states, ($state,$index) );
$state = $1;
$index = $2;
# print "State = $state, index = $index\n";
}
my $output = $line;
chomp $output;
for ($output) {
s/stacking="row"/stacking="temp"/;
s/stacking="column"/stacking="row"/;
s/stacking="temp"/stacking="column"/;
}
if ( $state =~ /related display/ ) {
for ($output) {
s/menu_title=/label=/;
}
}
elsif ( $state =~ /toggle button/ ) {
for ($output) {
s/toggle button/choice button/;
}
}
elsif ( $state =~ /message button/ ) {
for ($output) {
s/inactive_label=/label=/;
}
}
elsif ( $state =~ /display/ ) {
for ($output) {
s/\.dl/.adl/;
}
$output = "" if ( $index > 7 );
}
print "$output\n" if $output;
# Check to see if we are at the end of a block
if ( $line =~ /^\s*\}\s*$/ ) {
$index = pop( @states );
$state = pop( @states );
}
}
- References:
- Re: DM to EDM Rolf Keitel
- Navigate by Date:
- Prev:
Re: 3.14 questions (memory footprint) Alan K Biocca
- Next:
Re: VDCT - Visual DCT Jim Thomas
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
<2002>
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: DM to EDM Rolf Keitel
- Next:
about VDCT Xuedong Chai
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
<2002>
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|