source: trunk/tmdmcreator/build/update-tmdmcreator.py @ 5

Revision 5, 1.8 KB checked in by lucsch, 12 years ago (diff)

renaming python build script

Line 
1#!/usr/bin/env python
2# encoding: utf-8
3"""
4update-tmdmcreator.py
5
6Created by Lucien Schreiber on 2013-02-15.
7Copyright (c) 2013 . All rights reserved.
8"""
9
10import sys
11import os
12from subprocess import *
13
14# compatibililty Python 2.7 and 3.0
15try:
16  from Tkinter import *
17except:
18  from tkinter import *
19
20def GetCmakeDirName():
21  pathname = os.path.dirname(sys.argv[0])       
22  return os.path.abspath(pathname)
23
24
25def updateSVN():
26  myPath = os.path.normpath(os.path.join(GetCmakeDirName(), ".."))
27  print ("Updating subversion in: {}".format(myPath))
28  try:
29    p = Popen("svn update", shell=True, cwd = myPath)
30    p.wait()
31  except:
32    print ("Error updating subversion in: {}".format(myPath))
33
34  # print version number
35  try:
36    p = Popen("svnversion", shell=True, cwd=myPath, stdout=PIPE, stderr=PIPE)
37    information = p.communicate()
38    myVersion = str(information[0])
39    myVersionAlone = myVersion[myVersion.find("'")+1:-3] 
40    print ("Updated version is: {}".format(myVersionAlone))
41  except:
42    print("Error getting version for {}".format(GetCmakeDirName()))
43
44
45def buildMacBook():
46  builddir = "/Users/lucien/DATA/PRJ/TOOLMAP2/bin_apps/shpimporter"
47  try:
48    p = Popen("cmake -GXcode " + GetCmakeDirName() + "  -DCMAKE_OSX_ARCHITECTURES:TEXT=x86_64 -DCMAKE_OSX_DEPLOYMENT_TARGET:TEXT=10.6 -DCMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE:FILE=/Users/lucien/DATA/PROGRAMATION/_LIB/64/_LIBWXSVN/bin/wx-config", shell=True, cwd=builddir)
49    p.wait()
50  except:
51    print("Error creating makefile")
52
53
54
55if __name__ == '__main__':
56  root = Tk()
57  myContainer1 = Frame(root)
58  myContainer1.pack()
59
60  label = Label(myContainer1, text="TmDmCreator")
61  label.pack()
62
63  button3 = Button(myContainer1, text=("Update subversion"), command=updateSVN)
64  button3.pack()
65
66  button2 = Button(myContainer1, text="Configure MacBook", command=buildMacBook)
67  button2.pack()
68
69  root.mainloop()
Note: See TracBrowser for help on using the repository browser.