2 #When run on (my) windows box, this builds and cleans everything in
3 #preparation for a release.
8 #Replace version strings
10 oldVersion = sys.argv[1]
11 newVersion = sys.argv[2]
12 query = raw_input("Replace %s with %s?: " % (oldVersion, newVersion))
14 #First, scan through and make sure the replacement is possible
15 for filename in ("setup.py", "tlslite\\__init__.py", "scripts\\tls.py", "scripts\\tlsdb.py"):
16 s = open(filename, "rU").read()
17 x = s.count(oldVersion)
18 if filename.endswith("__init__.py"):
20 print "Error, old version appears in %s %s times" % (filename, x)
24 print "Error, old version appears in %s %s times" % (filename, x)
28 for filename in ("setup.py", "tlslite\\__init__.py", "scripts\\tls.py", "scripts\\tlsdb.py"):
29 os.system("copy %s .." % filename) #save a backup copy in case something goes awry
30 s = open(filename, "r").read()
31 f = open(filename, "w")
32 f.write(s.replace(oldVersion, newVersion))
36 #Make windows installers
37 os.system("del installers\*.exe")
40 os.system("rmdir build /s /q")
41 os.system("python23 setup.py bdist_wininst -o")
42 os.system("copy dist\* installers")
45 os.system("rmdir build /s /q")
46 os.system("python24 setup.py bdist_wininst -o")
47 os.system("copy dist\* installers")
51 os.system("python23 c:\\devtools\\python23\\scripts\\epydoc.py --html -o docs tlslite")
54 os.system("del tlslite\\*.pyc")
55 os.system("del tlslite\\utils\\*.pyc")
56 os.system("del tlslite\\integration\\*.pyc")
57 os.system("rmdir build /s /q")
58 os.system("rmdir dist /s /q")