def project_from_workspace_path()

in scripts/xcresult_logs.py [0:0]


def project_from_workspace_path(path):
  """Extracts the project name from a workspace path.
  Args:
    path: The path to a .xcworkspace file

  Returns:
    The project name from the basename of the path. For example, if path were
    'Firestore/Example/Firestore.xcworkspace', returns 'Firestore'.
  """
  root, ext = os.path.splitext(os.path.basename(path))
  if ext == '.xcworkspace':
    _logger.debug('Using project %s from workspace %s', root, path)
    return root

  raise ValueError('%s is not a valid workspace path' % path)