def save_sigma_file():
"""Brings up a file dialog box, so the user can choose a
file for saving the current SIGMA diagram. Then converts
the diagram to XML and saves it."""
import tkFileDialog
savefile = tkFileDialog.asksaveasfilename(
filetypes=[("SIGMA Diagram files", ".igm")],
defaultextension=".igm")
if savefile:
dom = makeSigmaDOM()
try:
f = open(savefile, "w")
dom.writexml(f)
f.close()
#global DIRTY; DIRTY = False
except:
print "Couldn't write the file: ", savefile
raise
评论列表
文章目录