#NEWLINE# def find_packages( directory ) : #NEWLINE# #INDENT# ( packages , data_files ) = ( [ ] , [ ] ) #NEWLINE# root_dir = os . path . dirname ( __file__ ) #NEWLINE# if ( root_dir != '' ) : #NEWLINE# #INDENT# os . chdir ( root_dir ) #NEWLINE# #UNINDENT# for ( dirpath , dirnames , filenames ) in os . walk ( directory ) : #NEWLINE# #INDENT# if ( not dirpath . startswith ( 'mayan/media' ) ) : #NEWLINE# #INDENT# if os . path . basename ( dirpath ) . startswith ( '.' ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( '__init__.py' in filenames ) : #NEWLINE# #INDENT# packages . append ( '.' . join ( fullsplit ( dirpath ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if filenames : #NEWLINE# #INDENT# data_files . append ( [ dirpath , [ os . path . join ( dirpath , f ) for f in filenames ] ] ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return filenames