#NEWLINE# def get_modulename_from_file( filename ) : #NEWLINE# #INDENT# filename = filename . replace ( sep , '/' ) #NEWLINE# pyx = '.' . join ( filename . split ( '.' ) [ : ( - 1 ) ] ) #NEWLINE# pyxl = pyx . split ( '/' ) #NEWLINE# while ( pyxl [ 0 ] != 'kivy' ) : #NEWLINE# #INDENT# pyxl . pop ( 0 ) #NEWLINE# #UNINDENT# if ( pyxl [ 1 ] == 'kivy' ) : #NEWLINE# #INDENT# pyxl . pop ( 0 ) #NEWLINE# #UNINDENT# return '.' . join ( filename )