#NEWLINE# def is_child_of( self , parent ) : #NEWLINE# #INDENT# 'Asserts that val is an existing path to a file and that file is a child of parent.' #NEWLINE# self . is_file ( ) #NEWLINE# if ( not isinstance ( parent , str_types ) ) : #NEWLINE# #INDENT# raise TypeError ( 'given parent directory arg must be a path' ) #NEWLINE# #UNINDENT# val_abspath = os . path . abspath ( self . val ) #NEWLINE# parent_abspath = os . path . abspath ( parent ) #NEWLINE# if ( not val_abspath . startswith ( parent_abspath ) ) : #NEWLINE# #INDENT# self . _err ( ( 'Expected file <%s> to be a child of <%s>, but was not.' % ( val_abspath , parent_abspath ) ) ) #NEWLINE# #UNINDENT# return self