#NEWLINE# @ staticmethod #NEWLINE# def validate_arguments( log , whitelisted_args , args ) : #NEWLINE# #INDENT# 'Validate that all arguments match whitelisted regexes.' #NEWLINE# valid_patterns = { re . compile ( p ) : validate for ( p , v ) in whitelisted_args . items ( ) } #NEWLINE# def validate( idx ) : #NEWLINE# #INDENT# arg = args [ idx ] #NEWLINE# for ( pattern , has_argument ) in valid_patterns . items ( ) : #NEWLINE# #INDENT# if pattern . match ( arg ) : #NEWLINE# #INDENT# return ( 2 if has_argument else 1 ) #NEWLINE# #UNINDENT# #UNINDENT# log . warn ( "Zinc argument '{}' is not supported, and is subject to change/removal!" . format ( arg ) ) #NEWLINE# return 1 #NEWLINE# #UNINDENT# arg_index = 0 #NEWLINE# while ( arg_index < len ( args ) ) : #NEWLINE# #INDENT# arg_index += validate ( arg_index )