#NEWLINE# def add_files( root_folder , user , path ) : #NEWLINE# #INDENT# ret = [ ] #NEWLINE# for f in os . listdir ( path ) : #NEWLINE# #INDENT# p = os . path . join ( path , f ) #NEWLINE# if os . path . isdir ( p ) : #NEWLINE# #INDENT# ret . extend ( add_files ( root_folder , user , p ) ) #NEWLINE# continue #NEWLINE# #UNINDENT# ( pk , fname ) = split_file_name ( f ) #NEWLINE# if ( file is False ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# file = ZornaFile ( description = '' , owner = user , modifier = user , folder = root_folder ) #NEWLINE# file . save ( ) #NEWLINE# dest = os . path . join ( path , ( '%s,%s' % ( file . pk , f ) ) ) #NEWLINE# os . rename ( p , dest ) #NEWLINE# ret . append ( p ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ret