#NEWLINE# def get_versions( default = { #NEWLINE# #INDENT# 'version' : 'unknown' , #NEWLINE# 'full' : '' , #NEWLINE# #UNINDENT# } , verbose = False ) : #NEWLINE# #INDENT# keywords = { #NEWLINE# #INDENT# 'refnames' : git_refnames , #NEWLINE# 'full' : git_full , #NEWLINE# #UNINDENT# } #NEWLINE# ver = git_versions_from_keywords ( keywords , tag_prefix , verbose ) #NEWLINE# if ver : #NEWLINE# #INDENT# return ver #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# root = os . path . abspath ( __file__ ) #NEWLINE# for i in range ( len ( versionfile_source . split ( os . sep ) ) ) : #NEWLINE# #INDENT# root = os . path . dirname ( root ) #NEWLINE# #UNINDENT# #UNINDENT# except NameError : #NEWLINE# #INDENT# return default #NEWLINE# #UNINDENT# return ( git_versions_from_vcs ( tag_prefix , root , verbose ) or versions_from_parentdir ( parentdir_prefix , root , verbose ) or default )