Ejemplo n.º 1
0
def testDatabase(): # rig:3
    def show(thing):
        print thing
        return thing
    def reportToDb(reporterFunc):
        return reporterFunc({"test_performed":time.time()})
    return pipeline(checkForTestingData(), 
                    readBytes,
		    str.strip,
                    genReporter,
                    reportToDb,
                    show)
Ejemplo n.º 2
0
def readFromFile(filePath, alternate, mode, *etc): # rig:3 
    '''Failed to open file.'''
    return pipeline(firstGood(readFile(filePath, mode), alternate), *etc)
Ejemplo n.º 3
0
def readFile(filePath, mode, *etc): # rig:3
    '''Failed to load file'''
    return pipeline(filePath,
                      fpth,
                      partial(loadf, mode),
                      *etc)
Ejemplo n.º 4
0
def writeLines(filePath, *lines): # rig:3 
    return pipeline(filePath,
                      fpth,
                      partial(loadf, "wt"),
                      partial(writeTo, lines))
Ejemplo n.º 5
0
def _dbUsageGen(dbHost, finalUserFunc, collection):
    return pipeline(dbHost, establishConnection, useDatabase,
                    partial(getCollectionObj, collection), finalUserFunc)