#NEWLINE# def _addUnit( name , unit ) : #NEWLINE# #INDENT# if ( name in _unit_table ) : #NEWLINE# #INDENT# raise KeyError ( ( ( 'Unit ' + name ) + ' already defined' ) ) #NEWLINE# #UNINDENT# if isinstance ( unit , basestring ) : #NEWLINE# #INDENT# unit = eval ( unit , _unit_table ) #NEWLINE# for cruft in [ '__builtins__' , '__args__' ] : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# del _unit_table [ cruft ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# unit . setName ( name ) #NEWLINE# _unit_table [ name ] = unit