#NEWLINE# @ signalcommand #NEWLINE# def handle( self , * args , **options ) : #NEWLINE# #INDENT# if args : #NEWLINE# #INDENT# ( appname , ) = args #NEWLINE# #UNINDENT# style = color_style ( ) #NEWLINE# if getattr ( settings , 'ADMIN_FOR' , None ) : #NEWLINE# #INDENT# settings_modules = [ __import__ ( m , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ '' ] ) for m in settings . ADMIN_FOR ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# settings_modules = [ settings ] #NEWLINE# #UNINDENT# for settings_mod in settings_modules : #NEWLINE# #INDENT# for app in settings_mod . INSTALLED_APPS : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# templatetag_mod = __import__ ( ( app + '.templatetags' ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , [ '' ] ) #NEWLINE# #UNINDENT# except ImportError : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# mod_path = inspect . getabsfile ( templatetag_mod ) #NEWLINE# mod_files = os . listdir ( os . path . dirname ( mod_path ) ) #NEWLINE# tag_files = [ i . rstrip ( '.py' ) for i in mod_files if ( i . endswith ( '.py' ) and ( i [ 0 ] != '_' ) ) ] #NEWLINE# app_labeled = False #NEWLINE# for taglib in tag_files : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# lib = get_library ( taglib ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( not app_labeled ) : #NEWLINE# #INDENT# self . add_result ( ( 'App: %s' % style . MODULE_NAME ( app ) ) ) #NEWLINE# app_labeled = True #NEWLINE# #UNINDENT# self . add_result ( ( 'load: %s' % style . TAGLIB ( taglib ) ) , 1 ) #NEWLINE# for ( items , label , style_func ) in [ ( lib . tags , 'Tag:' , style . TAG ) , ( lib . filters , 'Filter:' , style . FILTER ) ] : #NEWLINE# #INDENT# for item in items : #NEWLINE# #INDENT# self . add_result ( ( '%s %s' % ( label , style_func ( item ) ) ) , 2 ) #NEWLINE# doc = inspect . getdoc ( items [ item ] ) #NEWLINE# if doc : #NEWLINE# #INDENT# self . add_result ( format_block ( doc , 12 ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return label . results