equal
deleted
inserted
replaced
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 |