コード例 #1
0
ファイル: twistedServer.py プロジェクト: pgetta/atomizer
    def extractMoleculeTypes(self,ticket,bnglContents, bnglContents2):

        moleculeTypesList = []
        for element in [bnglContents, bnglContents2]:
            pointer = tempfile.mkstemp(suffix='.bngl', text=True)
            with open(pointer[1], 'w') as f:
                f.write(element)
            print pointer[1]
            consoleCommands.setBngExecutable(bngDistro)
            consoleCommands.bngl2xml(pointer[1])

            xmlFileName = pointer[1].split('.')[0] + '.xml'
            xmlFileName = xmlFileName.split(os.sep)[-1]
            moleculeTypes, _, _ = readBNGXML.parseXML(xmlFileName)
            moleculeTypesList.append(moleculeTypes)
            os.remove(xmlFileName)
        self.addToDict(ticket, moleculeTypesList)
        print 'success', ticket
コード例 #2
0
def extractRulesFromFile(fileName):
    species, rules, par = readBNGXML.parseXML(fileName)
    return rules
コード例 #3
0
def extractMoleculeTypesFromFile(fileName):
    species, rules, par = readBNGXML.parseXML(fileName)
    return species