def UpdateIncludeState(filename, include_state, io=codecs):
 headerfile = None
 try:
  headerfile = io.open(filename, 'r', 'utf8', 'replace')
 except IOError:
  return False
 linenum = 0
 for line in headerfile:
  linenum += 1
  clean_line = CleanseComments(line)
  match = _RE_PATTERN_INCLUDE.search(clean_line)
  if match:
   include = match.group(2)
   include_state.setdefault(include, ('%s:%d' % (filename, linenum)))
 return True

def UpdateIncludeState ( filename , include_state , io = codecs ) : headerfile = None try : headerfile = io . open ( filename , 'r' , 'utf8' , 'replace' ) except IOError : return False linenum = 0 for line in headerfile : linenum += 1 clean_line = CleanseComments ( line ) match = _RE_PATTERN_INCLUDE . search ( clean_line ) if match : include = match . group ( 2 ) include_state . setdefault ( include , ( '%s:%d' % ( filename , linenum ) ) ) return True
fill up the include_dict with new includes found from the file .