Example #1
0
def bump(repo, bumpFiles, versionKey):
    for f, info in bumpFiles.iteritems():
        fileToBump = path.join(repo, f)
        contents = open(fileToBump).read()
        newContents = bumpFile(f, contents, info[versionKey])
        if contents != newContents:
            fh = open(fileToBump, "w")
            fh.write(newContents)
            fh.close()
Example #2
0
def bump(repo, bumpFiles, versionKey):
    for f, info in bumpFiles.iteritems():
        fileToBump = path.join(repo, f)
        contents = open(fileToBump).read()
        # If info[versionKey] is a function, this function will do the bump.
        # It takes the old contents as its input to generate the new content.
        if callable(info[versionKey]):
            newContents = info[versionKey](contents)
        else:
            newContents = bumpFile(f, contents, info[versionKey])
        if contents != newContents:
            fh = open(fileToBump, "w")
            fh.write(newContents)
            fh.close()
Example #3
0
def bump(repo, bumpFiles, versionKey):
    for f, info in bumpFiles.iteritems():
        fileToBump = path.join(repo, f)
        contents = open(fileToBump).read()
        # If info[versionKey] is a function, this function will do the bump.
        # It takes the old contents as its input to generate the new content.
        if callable(info[versionKey]):
            newContents = info[versionKey](contents)
        else:
            newContents = bumpFile(f, contents, info[versionKey])
        if contents != newContents:
            fh = open(fileToBump, "w")
            fh.write(newContents)
            fh.close()
Example #4
0
 def _doTest(self, filename, oldContents, expectedContents, version):
     newContents = bumpFile(filename, oldContents, version)
     self.assertEquals(newContents, expectedContents)
Example #5
0
 def _doTest(self, filename, oldContents, expectedContents, version):
     newContents = bumpFile(filename, oldContents, version)
     self.assertEquals(newContents, expectedContents)