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

Source Code for Module install

 1  #!/usr/bin/env python 
 2  # -*- coding: utf8 -*- 
 3  # 
 4  #    Project: 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:       Jérôme 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  """ 
30   
31  EDNA-Builder for the fabio image library 
32   
33  """ 
34  __contact__ = "Jerome.Kieffer@ESRF.eu" 
35  __author__ = "Jerome Kieffer" 
36  __license__ = "GPLv3+" 
37  __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" 
38   
39  strArchiveName = "fabio-0.0.7.tar.gz" 
40   
41  import os, sys 
42   
43  #to be compatible with windows 
44  #strEdnaHome = os.path.join(os.sep, *tuple(os.path.abspath(sys.argv[0]).split(os.sep)[:-3])) 
45  from os.path  import dirname 
46  strEdnaHome = dirname(dirname(dirname(os.path.abspath(sys.argv[0])))) 
47   
48  if ("EDNA_HOME" in os.environ): 
49      if  (os.environ["EDNA_HOME"] != strEdnaHome): 
50          print("Warning: EDNA_HOME redefined to %s" % strEdnaHome) 
51          os.environ["EDNA_HOME"] = strEdnaHome 
52  else: 
53      os.environ["EDNA_HOME"] = strEdnaHome 
54  sys.path.append(os.path.join(os.environ["EDNA_HOME"], "kernel", "src")) 
55  from EDUtilsLibraryInstaller import EDUtilsLibraryInstaller 
56  from EDVerbose import EDVerbose 
57   
58   
59  if __name__ == "__main__": 
60      installDir = os.path.abspath(sys.argv[0]).split(os.sep)[-2] 
61      EDVerbose.screen("Building %s" % installDir) 
62      install = EDUtilsLibraryInstaller(installDir, strArchiveName) 
63      install.checkPythonVersion() 
64      install.downloadLibrary() 
65      install.dependency("numpy", "20090405-Numpy-1.3") 
66      install.unZipArchive() 
67      try: 
68          install.buildSources() 
69      except Exception: 
70          EDVerbose.ERROR("Error in the build") 
71      install.installBuilt() 
72      if not EDVerbose.isVerboseDebug(): 
73          install.cleanSources() 
74   
75  else: 
76      EDVerbose.ERROR("This installer program is not made to be imported, please just run it") 
77