equal
deleted
inserted
replaced
22 # along with this program; if not, write to the Free Software |
22 # along with this program; if not, write to the Free Software |
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
23 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
24 |
24 |
25 |
25 |
26 import subprocess, os |
26 import subprocess, os |
|
27 import util.paths as paths |
27 |
28 |
28 def GetAppRevision(): |
29 def GetAppRevision(): |
29 rev = None |
30 rev = None |
30 app_dir=os.path.dirname(os.path.realpath(__file__)) |
31 app_dir=paths.AbsDir(__file__) |
31 try: |
32 try: |
32 pipe = subprocess.Popen( |
33 pipe = subprocess.Popen( |
33 ["hg", "id", "-i"], |
34 ["hg", "id", "-i"], |
34 stdout = subprocess.PIPE, |
35 stdout = subprocess.PIPE, |
35 cwd = app_dir |
36 cwd = app_dir |
86 '\n' |
87 '\n' |
87 '\n' |
88 '\n' |
88 '') |
89 '') |
89 |
90 |
90 # read license file |
91 # read license file |
91 path=os.path.join(os.path.dirname(os.path.abspath(__file__))) |
92 path=paths.AbsDir(__file__) |
92 license_path = os.path.join(path, u"COPYING") |
93 license_path = os.path.join(path, "COPYING") |
93 license='' |
94 license='' |
94 if os.path.exists(license_path): |
95 if os.path.exists(license_path): |
95 with open(license_path) as f: |
96 with open(license_path) as f: |
96 info.License += f.read() |
97 info.License += f.read() |
97 |
98 |