LSSTApplications  1.1.2+25,10.0+13,10.0+132,10.0+133,10.0+224,10.0+41,10.0+8,10.0-1-g0f53050+14,10.0-1-g4b7b172+19,10.0-1-g61a5bae+98,10.0-1-g7408a83+3,10.0-1-gc1e0f5a+19,10.0-1-gdb4482e+14,10.0-11-g3947115+2,10.0-12-g8719d8b+2,10.0-15-ga3f480f+1,10.0-2-g4f67435,10.0-2-gcb4bc6c+26,10.0-28-gf7f57a9+1,10.0-3-g1bbe32c+14,10.0-3-g5b46d21,10.0-4-g027f45f+5,10.0-4-g86f66b5+2,10.0-4-gc4fccf3+24,10.0-40-g4349866+2,10.0-5-g766159b,10.0-5-gca2295e+25,10.0-6-g462a451+1
LSSTDataManagementBasePackage
eupsForScons.py
Go to the documentation of this file.
1 import os
2 
3 try:
4  from eups import *
5 except ImportError:
6  #
7  # Fake what we can so sconsUtils can limp along without eups
8  #
9  def flavor():
10  from .state import env, log
11 
12  log.warn("Unable to import eups; guessing flavor")
13 
14  if env['PLATFORM'] == "posix":
15  return os.uname()[0].title()
16  else:
17  return env['PLATFORM'].title()
18 
19  def productDir(name):
20  return os.environ.get("%s_DIR" % name.upper())
21 
22  def findSetupVersion(eupsProduct):
23  return None, None, None, None, flavor()
24 
25  class _Eups(object):
26  def __call__(self):
27  return self
28  Eups = _Eups()
29 
30  Eups.findSetupVersion = findSetupVersion
31 
32  class _Utils(object):
33  pass
34  utils = _Utils()
35 
36  def setupEnvNameFor(productName):
37  return "SETUP_%s" % productName
38 
39  utils.setupEnvNameFor = setupEnvNameFor
40 
41 def getEups():
42  """ Return a cached Eups instance, auto-creating if necessary """
43  try:
44  return getEups._eups
45  except AttributeError:
46  getEups._eups = Eups()
47  return getEups._eups