<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=Arial size=2>Below is a Python function
that demonstrates both dumping to and loading from xme. As you
can see, the MgaDumper and MgaParser are very straightforward.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Courier size=2>def
PerformUpgrade(path):<BR> import os, os.path, tempfile<BR> tmpdpath =
tempfile.mkdtemp()<BR> projectdir =
os.path.split(path)[0]<BR> projectfile =
os.path.split(path)[1]<BR> newproject = os.path.join(tmpdpath,
projectfile)<BR> xmefile = os.path.splitext(projectfile)[0] +
'.xme'<BR> xmepath = os.path.join(tmpdpath, xmefile)</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT face=Courier size=2> import win32com.client<BR> import
pythoncom</FONT></DIV>
<DIV><FONT face=Courier></FONT> </DIV>
<DIV><FONT size=2><FONT
face=Courier> win32ui.DoWaitCursor(1)<BR> try:<BR> project
=
win32com.client.DispatchEx("Mga.MgaProject")<BR> project.Open("MGA="
+ path)<BR> dumper =
win32com.client.DispatchEx("Mga.MgaDumper")<BR> dumper.DumpProject(project,
xmepath)<BR> project.Close()</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Courier> </FONT><FONT
face=Arial>...</FONT></FONT></DIV>
<DIV><FONT size=2><FONT face=Courier> project.Create("MGA=" +
newproject, "VaNTH")<BR> parser =
win32com.client.DispatchEx("Mga.MgaParser")<BR> parser.ParseProject(project,
xmepath)<BR> project.Close()<BR> os.rename(path,
path+'.orig')<BR> os.rename(newproject, path)<BR> #
DisplayMsg("Upgrade
successful...")<BR> except:<BR> project.Close()<BR> #
DisplayMsg("Upgrading failed...</FONT><FONT face=Courier>")</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT face=Courier
size=3></FONT> </DIV></FONT>
<DIV><FONT face=Arial size=2>----- Original Message ----- </FONT>
<DIV><FONT face=Arial size=2>From: "Gabriele Trombetti" <</FONT><A
href="mailto:gabtromb@isis.vanderbilt.edu"><FONT face=Arial
size=2>gabtromb@isis.vanderbilt.edu</FONT></A><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>To: "'A list for GME users to share thoughts and
discuss bugs and fixes.'" <</FONT><A
href="mailto:gme-users@list.isis.vanderbilt.edu"><FONT face=Arial
size=2>gme-users@list.isis.vanderbilt.edu</FONT></A><FONT face=Arial
size=2>></FONT></DIV>
<DIV><FONT face=Arial size=2>Sent: Monday, May 24, 2004 6:26 PM</FONT></DIV>
<DIV><FONT face=Arial size=2>Subject: [gme-users] How to convert .xme to .mga
programmatically?</FONT></DIV></DIV>
<DIV><FONT face=Arial><BR><FONT size=2></FONT></FONT></DIV><FONT face=Arial
size=2>> I need to convert an .xme file to the .mga format from a standalone
<BR>> program, in a no-user-prompt way. (I know which is the
paradigm)<BR>> Is it possible in any way?<BR>> <BR>> Thanks in
advance<BR>> Gabriele<BR>>
_______________________________________________<BR>> gme-users mailing
list<BR>> </FONT><A href="mailto:gme-users@list.isis.vanderbilt.edu"><FONT
face=Arial size=2>gme-users@list.isis.vanderbilt.edu</FONT></A><BR><FONT
face=Arial size=2>> </FONT><A
href="http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users"><FONT
face=Arial
size=2>http://list.isis.vanderbilt.edu/mailman/listinfo/gme-users</FONT></A><BR><FONT
face=Arial size=2>> </FONT></BODY></HTML>