#NEWLINE# def print_deprecated_uses( paths ) : #NEWLINE# #INDENT# dep_names = set ( ) #NEWLINE# dep_files = set ( ) #NEWLINE# for path in sorted ( paths ) : #NEWLINE# #INDENT# if os . path . isdir ( path ) : #NEWLINE# #INDENT# dep_names . update ( print_deprecated_uses ( [ os . path . join ( path , f ) for f in os . listdir ( path ) ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if path . endswith ( '.py' ) : #NEWLINE# #INDENT# print_deprecated_uses_in ( open ( path ) . readline , path , dep_files , dep_names , 0 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( path . endswith ( '.doctest' ) or path . endswith ( '.txt' ) ) : #NEWLINE# #INDENT# for example in DocTestParser ( ) . get_examples ( open ( path ) . read ( ) ) : #NEWLINE# #INDENT# ex = StringIO ( example . source ) #NEWLINE# try : #NEWLINE# #INDENT# print_deprecated_uses_in ( ex . readline , ex , dep_files , dep_names , example . lineno ) #NEWLINE# #UNINDENT# except tokenize . TokenError : #NEWLINE# #INDENT# print ( ( ( term . RED + 'Caught TokenError -- malformatted doctest?' ) + term . NORMAL ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return dep_names