Ejemplo n.º 1
0
 def testJsonReadAndWriteSqg(self):
     for include in self.jsonFiles:
         logger.info("Going to use jsonRead to parse/write/parse SQG %s" % include)
         #First read
         file = os.path.join(getPysqgIncludeDir(), include + ".json")
         sqg = readJsonSqgFile(file)
         #Then write
         writeJsonSqgFile(sqg, self.tempFile)
         #Now parse again
         readJsonSqgFile(self.tempFile)
Ejemplo n.º 2
0
 def fn4(i, putOnDiskArraysInJsonSqg=False):
     """Write and then re-read the sqg in a temporary file
     """
     sqg, graph = i
     tempFile = getTempFile(rootDir=os.getcwd())
     self.tempFiles.append(tempFile)
     writeJsonSqgFile(sqg, tempFile, putOnDiskArraysInJsonSqg=putOnDiskArraysInJsonSqg)
     sqg = readJsonSqgFile(tempFile)
     return sqg, graph
Ejemplo n.º 3
0
def parseInclude(include):
    includeFile = os.path.join(getPysqgIncludeDir(), include + ".json")
    logger.debug("Going to parse the include file: %s", includeFile)
    from pysqg.jsonSqg import readJsonSqgFile
    return readJsonSqgFile(includeFile)