<s> import os <EOL> from optparse import make_option <EOL> from django . core . management . base import LabelCommand <EOL> from django . utils . encoding import smart_str , smart_unicode <EOL> from django . contrib . staticfiles import finders <EOL> class Command ( LabelCommand ) : <EOL> help = "<STR_LIT>" <EOL> args = "<STR_LIT>" <EOL> label = '<STR_LIT>' <EOL> option_list = LabelCommand . option_list + ( <EOL> make_option ( '<STR_LIT>' , action = '<STR_LIT>' , dest = '<STR_LIT:all>' , default = True , <EOL> help = "<STR_LIT>" ) , <EOL> ) <EOL> def handle_label ( self , path , ** options ) : <EOL> verbosity = int ( options . get ( '<STR_LIT>' , <NUM_LIT:1> ) ) <EOL> result = finders . find ( path , all = options [ '<STR_LIT:all>' ] ) <EOL> path = smart_unicode ( path ) <EOL> if result : <EOL> if not isinstance ( result , ( list , tuple ) ) : <EOL> result = [ result ] <EOL> output = u'<STR_LIT>' . join ( <EOL> ( smart_unicode ( os . path . realpath ( path ) ) for path in result ) ) <EOL> self . stdout . write ( <EOL> smart_str ( u"<STR_LIT>" % ( path , output ) ) ) <EOL> else : <EOL> if verbosity >= <NUM_LIT:1> : <EOL> self . stderr . write ( <EOL> smart_str ( "<STR_LIT>" % path ) ) </s>
