Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Save a clues to a file.

@param filename: Name of the file where the clues will be written to.
@type filename: C{str}

@param clues: Sequence of clues to write.
@type clues: C{list}

        def save(filename, clues):
    """Save a clues to a file.

    @param filename: Name of the file where the clues will be written to.
    @type filename: C{str}

    @param clues: Sequence of clues to write.
    @type clues: C{list}
    """
    # Create or truncate the destination file.
    cluefp = open(filename, 'w+')
    writer = csv.writer(cluefp)

    for clue in clues:
        # Store the most relevant clue information.
        writer.writerow((clue.getCount(), clue._local, clue.headers))

    cluefp.close()
        


src/h/a/halberd-0.2.4/tests/test_clues_file.py   halberd(Download)
    def testSimpleSaveAndLoad(self):
        try:
            Halberd.clues.file.save(self.filename, [self.clue])
            clues = Halberd.clues.file.load(self.filename)
        finally:

src/h/a/halberd-HEAD/tests/test_clues_file.py   halberd(Download)
    def testSimpleSaveAndLoad(self):
        try:
            Halberd.clues.file.save(self.filename, [self.clue])
            clues = Halberd.clues.file.load(self.filename)
        finally: