1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
--- a/get_pythia8_version.py 2021-04-07 07:31:51.000000000 +0800
+++ b/get_pythia8_version.py 2021-04-08 12:32:12.100076666 +0800
@@ -1,4 +1,4 @@
-#! /usr/bin/env python
+#!/usr/bin/env python
import sys
import os
@@ -6,7 +6,7 @@
import subprocess
pjoin = os.path.join
-local_path = os.path.abspath(os.path.dirname(os.path.realpath( __file__ )))
+local_path = '/usr'
error_exit_code = 9
@@ -22,21 +22,21 @@
print( help_msg)
sys.exit(error_exit_code)
-pythia8_path = os.path.abspath(os.path.realpath(sys.argv[1]))
+pythia8_path = '/usr'
# The technique above didn't work, so we will try to obtain the version from the xml doc instead
version = None
def get_version_from_xml():
- if not os.path.exists(pjoin(pythia8_path,'share','Pythia8','xmldoc','Version.xml')):
+ if not os.path.exists(pjoin(pythia8_path,'share','pythia8','xmldoc','Version.xml')):
print( "Error in 'get_pythia8_version.py': could not get Pyhtia8 file \n '%s'\n storing the version number"% \
- pjoin(local_path,'share','Pythia8','xmldoc','Version.xml'))
+ pjoin(local_path,'share','pythia8','xmldoc','Version.xml'))
return None
versionfinder = re.compile('^\s*\<parmfix\s*name\=\"Pythia:versionNumber\"\s*default=\"(?P<version>[\d\.]+)\"\>')
- for line in open(pjoin(pythia8_path,'share','Pythia8','xmldoc','Version.xml')):
+ for line in open(pjoin(pythia8_path,'share','pythia8','xmldoc','Version.xml')):
match = versionfinder.match(line)
if match:
version = match.group('version')
|