Révision 14

prepareQMX/prepareQMX.py (revision 14)
44 44
        
45 45
    myDefinition = None
46 46
    for definition in definitions:
47
        if definition.name == line:
47
        if definition.name.lower() == line.lower():
48 48
            myDefinition = deepcopy(definition)
49 49
            break
50 50
            
......
66 66
        if subsection == "program":
67 67
            continue
68 68
        if subsection == "options":
69
            subsection = 'class.options'
70
        
69
            subsection = 'class.options'        
71 70
        myDefinition.keywords[subsection] = line    
72
        print subsection, myDefinition.keywords[subsection]
73 71
    
74 72
    return myDefinition
75 73

  
......
109 107
definitions.append(QmxCalcDefinition())
110 108

  
111 109
#--- analyze the input file ------------------------------------------------------------------------
112
for section in "high-level", "low-level", "cluster", "system", "job":
110
for section in "high-level", "low-level", "cluster", "system", "job", "embed":
113 111
    #search lines for section
114 112
    lines_section=[]
115 113
    for line in lines:
prepareQMX/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