<s> """<STR_LIT>""" <EOL> from flask . _compat import string_types <EOL> from werkzeug . utils import import_string <EOL> from os import path as op <EOL> class Collect ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , app = None ) : <EOL> """<STR_LIT>""" <EOL> self . app = None <EOL> self . static_root = None <EOL> self . static_url = None <EOL> self . storage = None <EOL> self . filter = None <EOL> self . blueprints = None <EOL> if app : <EOL> self . init_app ( app ) <EOL> def init_app ( self , app ) : <EOL> """<STR_LIT>""" <EOL> if not hasattr ( app , '<STR_LIT>' ) : <EOL> app . extensions = dict ( ) <EOL> app . extensions [ '<STR_LIT>' ] = self <EOL> self . app = app <EOL> self . static_root = app . config . get ( <EOL> '<STR_LIT>' , <EOL> op . join ( <EOL> app . root_path , <EOL> '<STR_LIT>' ) ) . rstrip ( '<STR_LIT:/>' ) <EOL> self . static_url = app . static_url_path <EOL> self . storage = app . config . get ( <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> filter_ = app . config . get ( '<STR_LIT>' ) <EOL> if filter_ is not None and isinstance ( filter_ , string_types ) : <EOL> filter_ = import_string ( filter_ ) <EOL> self . filter = filter_ if filter_ is not None else list <EOL> self . blueprints = app . blueprints <EOL> def init_script ( self , manager ) : <EOL> """<STR_LIT>""" <EOL> def collect ( verbose = True ) : <EOL> """<STR_LIT>""" <EOL> return self . collect ( verbose = verbose ) <EOL> manager . command ( collect ) <EOL> def collect ( self , verbose = False ) : <EOL> """<STR_LIT>""" <EOL> mod = import_string ( self . storage ) <EOL> cls = getattr ( mod , '<STR_LIT>' ) <EOL> storage = cls ( self , verbose = verbose ) <EOL> return storage . run ( ) </s>
