<s> import os , sys <EOL> from subprocess import Popen , PIPE <EOL> def get_revision ( ) : <EOL> from django . conf import settings <EOL> old_path = os . getcwd ( ) <EOL> os . chdir ( settings . PROJECT_DIR ) <EOL> cmd = [ "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" ] <EOL> rev = Popen ( cmd , stdout = PIPE ) . communicate ( ) [ <NUM_LIT:0> ] . strip ( ) <EOL> os . chdir ( old_path ) <EOL> return rev <EOL> def set_cache ( rev ) : <EOL> from django . core . cache import cache <EOL> cache . set ( '<STR_LIT>' , rev , timeout = None ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . path . append ( os . environ [ '<STR_LIT>' ] ) <EOL> from django . core . management import setup_environ <EOL> from teerace import settings <EOL> setup_environ ( settings ) <EOL> rev = get_revision ( ) <EOL> set_cache ( rev ) </s>
