def externals_finder(dirname, filename):
 found = False
 f = open(filename, 'rt')
 for line in iter(f.readline, ''):
  parts = line.split()
  if (len(parts) == 2):
   (kind, length) = parts
   data = f.read(int(length))
   if ((kind == 'K') and (data == 'svn:externals')):
    found = True
   elif ((kind == 'V') and found):
    f.close()
    break
 else:
  f.close()
  return
 for line in data.splitlines():
  parts = line.split()
  if parts:
   (yield joinpath(dirname, parts[0]))

def externals_finder ( dirname , filename ) : found = False f = open ( filename , 'rt' ) for line in iter ( f . readline , '' ) : parts = line . split ( ) if ( len ( parts ) == 2 ) : ( kind , length ) = parts data = f . read ( int ( length ) ) if ( ( kind == 'K' ) and ( data == 'svn:externals' ) ) : found = True elif ( ( kind == 'V' ) and found ) : f . close ( ) break else : f . close ( ) return for line in data . splitlines ( ) : parts = line . split ( ) if parts : ( yield joinpath ( dirname , parts [ 0 ] ) )
find any svn:externals directories .