<s> '''<STR_LIT>''' <EOL> from django . utils . importlib import import_module <EOL> from django . db . models import signals <EOL> from django . conf import settings <EOL> import logging <EOL> logger = logging . getLogger ( "<STR_LIT>" ) <EOL> def post_syncdb_run ( sender , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> post_syncdb_run . queued = getattr ( post_syncdb_run , "<STR_LIT>" , [ ] ) <EOL> post_syncdb_run . perms_installed = getattr ( <EOL> post_syncdb_run , "<STR_LIT>" , False ) <EOL> app = sender . __name__ . split ( "<STR_LIT>" ) [ <NUM_LIT:0> ] <EOL> if app == "<STR_LIT>" : <EOL> post_syncdb_run . perms_installed = True <EOL> post_syncdb_run . queued . append ( app ) <EOL> if post_syncdb_run . perms_installed : <EOL> for app in post_syncdb_run . queued : <EOL> logger . debug ( "<STR_LIT>" % app ) <EOL> try : <EOL> mod = import_module ( "<STR_LIT>" % app ) <EOL> except ImportError as exc : <EOL> msg = exc . args [ <NUM_LIT:0> ] <EOL> if not msg . startswith ( '<STR_LIT>' ) or "<STR_LIT>" not in msg : <EOL> raise <EOL> else : <EOL> continue <EOL> try : <EOL> mod . run ( ) <EOL> logger . debug ( "<STR_LIT>" % app ) <EOL> except AttributeError as exc : <EOL> msg = "<STR_LIT:%s>" % exc <EOL> if msg == "<STR_LIT>" : <EOL> logger . warn ( <EOL> "<STR_LIT>" "<STR_LIT>" % app <EOL> ) <EOL> else : <EOL> raise <EOL> post_syncdb_run . queued = [ ] <EOL> signals . post_syncdb . connect ( post_syncdb_run ) </s>
