proxygen
cpp.utils Namespace Reference

Functions

def ReadFile (filename, print_error=True)
 

Variables

string __author__ = 'nnorwitz@google.com (Neal Norwitz)'
 
bool DEBUG = True
 

Function Documentation

def cpp.utils.ReadFile (   filename,
  print_error = True 
)
Returns the contents of a file.

Definition at line 30 of file utils.py.

30 def ReadFile(filename, print_error=True):
31  """Returns the contents of a file."""
32  try:
33  fp = open(filename)
34  try:
35  return fp.read()
36  finally:
37  fp.close()
38  except IOError:
39  if print_error:
40  print('Error reading %s: %s' % (filename, sys.exc_info()[1]))
41  return None
42 
def ReadFile(filename, print_error=True)
Definition: utils.py:30

Variable Documentation

string cpp.utils.__author__ = 'nnorwitz@google.com (Neal Norwitz)'
private

Definition at line 20 of file utils.py.

bool cpp.utils.DEBUG = True

Definition at line 27 of file utils.py.