00001
00002
00003
00004 import sys
00005
00006 VERSION = raw_input().strip()
00007
00008 def replace(filename):
00009 fh = open(filename, "r")
00010 content = fh.read()
00011 content = content.replace("_VERSION_", VERSION)
00012 fh.close()
00013
00014 fh = open(filename.replace("_draft", ""), "w")
00015 fh.write(content)
00016 fh.close()
00017
00018 def replace_line(filename):
00019 line_to_search_for = "#!!Version line "
00020 rep = False
00021
00022 fh = open(filename, "r")
00023 content = fh.read()
00024 fh.close()
00025
00026 output = ""
00027 for line in content.split("\n"):
00028 if line_to_search_for in line:
00029 rep = True
00030 line = "VERSION=\"%s\" %s" % (VERSION, line_to_search_for)
00031
00032 output += line + "\n"
00033
00034
00035
00036
00037
00038 fh = open(filename, "w")
00039 fh.write(output[0:-1])
00040 fh.close()
00041
00042 replace("about.glade_draft")
00043 replace("control_draft")
00044
00045 replace_line("modules/functions.py")
00046
00047 print VERSION