Module install
[hide private]
[frames] | no frames]

Source Code for Module install

 1  #!/usr/bin/env python 
 2  # -*- coding: utf8 -*- 
 3  # 
 4  #    Project: EDNA Libraries 
 5  #             http://www.edna-site.org 
 6  # 
 7  #    File: "$Id:$" 
 8  # 
 9  #    Copyright (C) European Synchrotron Radiation Facility, Grenoble, France 
10  # 
11  #    Principal author:       Jerome Kieffer (Jerome.Kieffer@ESRF.eu) 
12  # 
13  #    This program is free software: you can redistribute it and/or modify 
14  #    it under the terms of the GNU General Public License as published by 
15  #    the Free Software Foundation, either version 3 of the License, or 
16  #    (at your option) any later version. 
17  # 
18  #    This program is distributed in the hope that it will be useful, 
19  #    but WITHOUT ANY WARRANTY; without even the implied warranty of 
20  #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
21  #    GNU General Public License for more details. 
22  # 
23  #    You should have received a copy of the GNU General Public License 
24  #    along with this program.  If not, see <http://www.gnu.org/licenses/>. 
25  # 
26  # 
27  # 
28   
29  """EDNA-Builder for the SpecClient library""" 
30  __contact__ = "Jerome.Kieffer@ESRF.eu" 
31  __author__ = "Jerome Kieffer" 
32  __license__ = "GPLv3+" 
33  __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" 
34   
35   
36  import os, sys 
37  strEdnaHome = os.path.join(os.sep, *tuple(os.path.abspath(sys.argv[0]).split(os.sep)[:-3])) 
38  if ("EDNA_HOME" in os.environ): 
39      if  (os.environ["EDNA_HOME"] != strEdnaHome): 
40          print("Warning: EDNA_HOME redefined to %s" % strEdnaHome) 
41          os.environ["EDNA_HOME"] = strEdnaHome 
42  else: 
43      os.environ["EDNA_HOME"] = strEdnaHome 
44   
45  sys.path.append(os.path.join(strEdnaHome, "kernel", "src")) 
46  from EDUtilsLibraryInstaller    import EDUtilsLibraryInstaller 
47  from EDVerbose                  import EDVerbose 
48   
49   
50  strLibrary = "SpecClient.tar.bz2" 
51   
52   
53  if __name__ == "__main__": 
54      installDir = os.path.abspath(sys.argv[0]).split(os.sep)[-2] 
55      EDVerbose.screen("Building %s" % strLibrary) 
56      install = EDUtilsLibraryInstaller(installDir, strLibrary) 
57      install.checkPythonVersion() 
58      install.getArchitecture() 
59      install.downloadLibrary() 
60      install.getArchiveName() 
61      install.unZipArchive() 
62      install.buildSources() 
63      install.installBuilt() 
64      install.cleanSources() 
65   
66  else: 
67      print("This installer program is not made to be imported, please just run it") 
68