<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import logging <EOL> from optparse import OptionParser <EOL> CURRENT_PATH = os . path . realpath ( os . path . dirname ( __file__ ) ) <EOL> usage = "<STR_LIT>" <EOL> parser = OptionParser ( usage = usage ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , <EOL> default = "<STR_LIT>" , <EOL> metavar = "<STR_LIT>" ) <EOL> parser . add_option ( "<STR_LIT>" , "<STR_LIT>" , <EOL> dest = "<STR_LIT>" , <EOL> help = "<STR_LIT>" , <EOL> default = CURRENT_PATH , <EOL> metavar = "<STR_LIT>" <EOL> ) <EOL> ( options , args ) = parser . parse_args ( ) <EOL> logging . basicConfig ( <EOL> level = logging . getLevelName ( options . loglevel ) , <EOL> format = "<STR_LIT>" ) <EOL> logger = logging . getLogger ( "<STR_LIT>" ) <EOL> selectedpath = os . path . realpath ( os . path . normpath ( options . projectpath ) ) <EOL> if not os . path . exists ( selectedpath ) : <EOL> logger . critical ( '<STR_LIT>' % <EOL> selectedpath ) <EOL> logger . info ( '<STR_LIT>' % selectedpath ) <EOL> PATH_HEAD , PATH_TAIL = os . path . split ( selectedpath ) <EOL> logger . debug ( '<STR_LIT>' % PATH_HEAD ) <EOL> logger . debug ( '<STR_LIT>' % PATH_TAIL ) <EOL> os . chdir ( options . projectpath ) <EOL> sys . path . insert ( <NUM_LIT:0> , selectedpath ) <EOL> sys . path . insert ( <NUM_LIT:1> , PATH_HEAD ) <EOL> logger . debug ( '<STR_LIT>' % sys . path ) <EOL> os . environ [ '<STR_LIT>' ] = '<STR_LIT>' % PATH_TAIL <EOL> logger . debug ( '<STR_LIT>' % <EOL> os . environ [ '<STR_LIT>' ] ) <EOL> try : <EOL> import djangregator <EOL> except ImportError : <EOL> logger . critical ( "<STR_LIT>" ) <EOL> else : <EOL> djangregator . fetch ( ) </s>
