#NEWLINE# def psoc5lp_pin_name_process( name ) : #NEWLINE# #INDENT# leading_paren = re . compile ( '^\\s*(?P<paren>\\([^)]*\\))\\s*(?P<pin_name>.+)$' , re . IGNORECASE ) #NEWLINE# m = leading_paren . match ( name ) #NEWLINE# if ( m is not None ) : #NEWLINE# #INDENT# name = ( ( m . group ( 'pin_name' ) + ' ' ) + m . group ( 'paren' ) ) #NEWLINE# #UNINDENT# name = re . sub ( '^\\s+' , '' , name ) #NEWLINE# name = re . sub ( '\\s+$' , '' , name ) #NEWLINE# name = re . sub ( '\\s*([-@#$%^&*_=+|",.<>!;?]+)\\s*' , '\\1' , name ) #NEWLINE# name = re . sub ( '([\\[\\{\\(]+)\\s*' , '\\1' , name ) #NEWLINE# name = re . sub ( '\\s*([\\]\\}\\)]+)' , '\\1' , leading_paren ) #NEWLINE# name = re . sub ( '\\s+' , '_' , name ) #NEWLINE# return name