src/setup.py
changeset 188 00cf90eb0f5a
parent 179 e7c7e6e0a8bc
equal deleted inserted replaced
187:7c745d8cb321 188:00cf90eb0f5a
    59         print("Changing VERSION in %s to %r" % (filepath, self.version_tuple))
    59         print("Changing VERSION in %s to %r" % (filepath, self.version_tuple))
    60         fh, abs_path = mkstemp()
    60         fh, abs_path = mkstemp()
    61         with os.fdopen(fh,'w') as temp_file:
    61         with os.fdopen(fh,'w') as temp_file:
    62             with open(filepath, 'r') as initfiles:
    62             with open(filepath, 'r') as initfiles:
    63                 for l in initfiles:
    63                 for l in initfiles:
    64                     if re.match(r"\s*VERSION\s*=\s*\(\d+\s*,\s*\d+\s*,\s*\d+,\s*\".+\",\s*.+\s*\)", l):
    64                     if re.match(r"\s*VERSION\s*=\s*\(\d+\s*,\s*\d+\s*,\s*\d+,\s*[\"\'].+[\"\'],\s*.+\s*\)", l):
    65                         temp_file.write("VERSION = %r" % (self.version_tuple,))
    65                         temp_file.write("VERSION = %r\n" % (self.version_tuple,))
    66                     else:
    66                     else:
    67                         temp_file.write(l)
    67                         temp_file.write(l)
    68         os.remove(filepath)
    68         os.remove(filepath)
    69         move(abs_path, filepath)
    69         move(abs_path, filepath)
    70 
    70