proxygen
fbcode_builder Namespace Reference

Classes

class  FBCodeBuilder
 

Functions

def _read_project_github_hashes ()
 

Function Documentation

def fbcode_builder._read_project_github_hashes ( )
private

Definition at line 68 of file fbcode_builder.py.

References folly.format().

Referenced by fbcode_builder.FBCodeBuilder.__init__().

69  base_dir = 'deps/github_hashes/' # trailing slash used in regex below
70  for dirname, _, files in os.walk(base_dir):
71  for filename in files:
72  path = os.path.join(dirname, filename)
73  with open(path) as f:
74  m_proj = re.match('^' + base_dir + '(.*)-rev\.txt$', path)
75  if m_proj is None:
76  raise RuntimeError('Not a hash file? {0}'.format(path))
77  m_hash = re.match('^Subproject commit ([0-9a-f]+)\n$', f.read())
78  if m_hash is None:
79  raise RuntimeError('No hash in {0}'.format(path))
80  yield m_proj.group(1), m_hash.group(1)
81 
82 
Formatter< false, Args... > format(StringPiece fmt, Args &&...args)
Definition: Format.h:271
def _read_project_github_hashes()