LSSTApplications  11.0-13-gbb96280,12.1+18,12.1+7,12.1-1-g14f38d3+72,12.1-1-g16c0db7+5,12.1-1-g5961e7a+84,12.1-1-ge22e12b+23,12.1-11-g06625e2+4,12.1-11-g0d7f63b+4,12.1-19-gd507bfc,12.1-2-g7dda0ab+38,12.1-2-gc0bc6ab+81,12.1-21-g6ffe579+2,12.1-21-gbdb6c2a+4,12.1-24-g941c398+5,12.1-3-g57f6835+7,12.1-3-gf0736f3,12.1-37-g3ddd237,12.1-4-gf46015e+5,12.1-5-g06c326c+20,12.1-5-g648ee80+3,12.1-5-gc2189d7+4,12.1-6-ga608fc0+1,12.1-7-g3349e2a+5,12.1-7-gfd75620+9,12.1-9-g577b946+5,12.1-9-gc4df26a+10
LSSTDataManagementBasePackage
eupsForScons.py
Go to the documentation of this file.
1 from __future__ import absolute_import, division, print_function
2 import os
3 
4 try:
5  from eups import *
6  eupsLoaded = True
7 except ImportError:
8  eupsLoaded = False
9 
10 
11 def haveEups():
12  return eupsLoaded
13 
14 if not haveEups():
15  #
16  # Fake what we can so sconsUtils can limp along without eups
17  #
18  def flavor():
19  from .state import env, log
20 
21  log.warn("Unable to import eups; guessing flavor")
22 
23  if env['PLATFORM'] == "posix":
24  return os.uname()[0].title()
25  else:
26  return env['PLATFORM'].title()
27 
28  def productDir(name):
29  return os.environ.get("%s_DIR" % name.upper())
30 
31  def findSetupVersion(eupsProduct):
32  return None, None, None, None, flavor()
33 
34  class _Eups(object):
35  def __call__(self):
36  return self
37  Eups = _Eups()
38 
39  Eups.findSetupVersion = findSetupVersion
40 
41  class _Utils(object):
42  pass
43  utils = _Utils()
44 
45  def setupEnvNameFor(productName):
46  return "SETUP_%s" % productName
47 
48  utils.setupEnvNameFor = setupEnvNameFor
49 
50 
51 def getEups():
52  """ Return a cached Eups instance, auto-creating if necessary """
53  try:
54  return getEups._eups
55  except AttributeError:
56  getEups._eups = Eups()
57  return getEups._eups