예제 #1
0
 def get_release_from_binary(cls, binary):
     try:
         pex_info = PexInfo.from_pex(PythonDirectoryWrapper.get(binary))
         return cls.get_release_from_tag(
             pex_info.build_properties.get('tag', ''))
     except PythonDirectoryWrapper.Error:
         return 'UNKNOWN'
예제 #2
0
파일: launcher.py 프로젝트: billwei/commons
 def __init__(self, path):
     if not os.path.exists(path):
         raise PythonLauncher.NotFound("Could not find python environment in %s" % path)
     self._dir = PythonDirectoryWrapper.get(path)
     try:
         self._manifest = json.loads(self._dir.read(PythonLauncher.MANIFEST))
     except ValueError, e:
         raise PythonLauncher.InvalidFormat("Could not parse manifest! %s" % e)
예제 #3
0
    def __init__(self, eggheads):
        """
      eggheads = List of files or directories that end with ".egg" and point to
        valid eggs.

      Not intended to be called directly.  Instead use the from_* factory methods.
    """
        if not isinstance(eggheads, (types.ListType, types.TupleType)):
            raise ValueError("Expected eggs to be a list of filenames!  Got %s" % type(eggheads))
        self._eggs = {}
        for egg in eggheads:
            self._eggs[os.path.basename(egg)] = PythonDirectoryWrapper.get(egg)
예제 #4
0
파일: launcher.py 프로젝트: adamsxu/commons
 def __init__(self, path):
   if not os.path.exists(path):
     raise PythonLauncher.NotFound("Could not find python environment in %s" % path)
   self._dir = PythonDirectoryWrapper.get(path)
   try:
     self._manifest = self._dir.read(PythonLauncher.MANIFEST)
     if Compatibility.PY3:
       self._manifest = str(self._manifest, encoding='utf8')
     self._manifest = json.loads(self._manifest)
   except ValueError as e:
     raise PythonLauncher.InvalidFormat("Could not parse manifest! %s" % e)
   self._cache = EggCache(self._dir)
   self._path = OrderedSet([os.path.abspath(path)])
예제 #5
0
def version(args):
  """usage: version

  Prints information about the version of the aurora client being run.
  """
  try:
    pexpath = sys.argv[0]
    pex_info = PexInfo.from_pex(PythonDirectoryWrapper.get(pexpath))
    print("Aurora client build info:")
    print("\tsha: %s" % pex_info.build_properties['sha'])
    print("\tdate: %s" % pex_info.build_properties['date'])
  except (IOError, PythonDirectoryWrapper.Error):
    print("Aurora client build info not available")
  print("Aurora API version: %s" % CURRENT_API_VERSION)
 def get_release_from_binary(cls, binary):
   try:
     pex_info = PexInfo.from_pex(PythonDirectoryWrapper.get(binary))
     return cls.get_release_from_tag(pex_info.build_properties.get('tag', ''))
   except PythonDirectoryWrapper.Error:
     return 'UNKNOWN'
예제 #7
0
 def __init__(self, pex=sys.argv[0]):
   self._pex = PythonDirectoryWrapper.get(pex)
   self._pex_info = PexInfo.from_pex(self._pex)
   self._env = PEXEnvironment(self._pex.path(), self._pex_info)