#NEWLINE# @ register . tag #NEWLINE# def gizmo_dependencies( parser , token ) : #NEWLINE# #INDENT# '\n    Load all gizmo dependencies (JavaScript and CSS).\n\n    Example::\n\n        {% gizmo_dependencies css %}\n        {% gizmo_dependencies js %}\n    ' #NEWLINE# output_type = None #NEWLINE# bits = token . split_contents ( ) #NEWLINE# if ( len ( bits ) > 2 ) : #NEWLINE# #INDENT# raise TemplateSyntaxError ( '"{0}" takes at most one argument: the type of dependencies to output (either "js" or "css")' . format ( token . split_contents ( ) [ 0 ] ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( bits ) == 2 ) : #NEWLINE# #INDENT# output_type = bits [ 1 ] #NEWLINE# #UNINDENT# #UNINDENT# if output_type : #NEWLINE# #INDENT# if ( output_type [ 0 ] in ( '"' , "'" ) ) : #NEWLINE# #INDENT# output_type = output_type . replace ( "'" , '' ) #NEWLINE# output_type = output_type . replace ( '"' , '' ) #NEWLINE# #UNINDENT# output_type = output_type . lower ( ) #NEWLINE# if ( output_type not in VALID_OUTPUT_TYPES ) : #NEWLINE# #INDENT# raise TemplateSyntaxError ( 'Invalid output type specified: only "js" and "css" are allowed, "{0}" given.' . format ( output_type ) ) #NEWLINE# #UNINDENT# #UNINDENT# return TethysGizmoDependenciesNode ( output_type )