Révision 14 prepareQMX/prepareQMX.GUI.py
prepareQMX.GUI.py (revision 14) | ||
---|---|---|
155 | 155 |
#image = PhotoImage(file="exit.gif") |
156 | 156 |
buttonExit=Button(frame, text="Quit!", command=self.quit) |
157 | 157 |
#buttonExit.image = image |
158 |
buttonExit.grid(row=1, column = 1, rowspan=2, sticky= W+E+N+S)
|
|
158 |
buttonExit.grid(row=1, column = 1, rowspan=3, sticky= W+E+N+S)
|
|
159 | 159 |
|
160 | 160 |
buttonSave=Button(frame, text='save settings', state=DISABLED) |
161 | 161 |
buttonSave.grid(row=1, column = 2, sticky=(EW)) |
162 | 162 |
|
163 |
buttonPrint=Button(frame, text='Write qmx.py input file', command=self.writeButton)
|
|
164 |
buttonPrint.grid(row=2, column = 2, sticky=EW)
|
|
163 |
buttonScript=Button(frame, text='Write qmx.in input file', command=self.writeScript)
|
|
164 |
buttonScript.grid(row=2, column = 2, sticky=EW)
|
|
165 | 165 |
|
166 |
buttonPython=Button(frame, text='Write qmx.py script file', command=self.writePython) |
|
167 |
buttonPython.grid(row=3, column = 2, sticky=EW) |
|
168 |
|
|
166 | 169 |
frame.grid(row=2, column=2, sticky=SE) |
167 | 170 |
|
168 | 171 |
#--- MainWindow --- |
... | ... | |
172 | 175 |
def quit(self): |
173 | 176 |
quit() |
174 | 177 |
|
175 |
def writeButton(self):
|
|
178 |
def writePython(self):
|
|
176 | 179 |
file = open("qmx.py","w") |
177 | 180 |
definitions=[] |
178 | 181 |
for frame in self.frames: |
... | ... | |
183 | 186 |
writeData(file, definitions) |
184 | 187 |
file.close() |
185 | 188 |
os.system("chmod u+x qmx.py") |
189 |
|
|
190 |
|
|
191 |
def writeScript(self): |
|
192 |
file = open("qmx.in","w") |
|
193 |
for frame in self.frames: |
|
194 |
definition = frame.getSelection() |
|
195 |
if definition is None: |
|
196 |
continue |
|
186 | 197 |
|
198 |
system = definition.system.lower() |
|
199 |
data = system+".program : "+definition.name.lower()+"\n" |
|
200 |
file.write(data) |
|
201 |
for key in definition.keywords: |
|
202 |
data=system+"."+key+" : "+definition.getValue(key)+"\n" |
|
203 |
file.write(data) |
|
204 |
file.write("\n") |
|
205 |
file.close() |
|
206 |
|
|
187 | 207 |
def preview(self): |
188 | 208 |
stream = StringIO.StringIO() |
189 | 209 |
definitions=[] |
Formats disponibles : Unified diff