Exemple #1
0
def shelve(site, modified_only=False):
    "Shelve an application's stash, as a worker process."
    with no_pyc():
        # Create shelve time dir if it does not exist
        try: os.makedirs(SHELVE_TIME_DIR)
        except (IOError, OSError): pass

        shelve_time_path = os.path.join(SHELVE_TIME_DIR, site)
        os.environ['SHELVE_TIME_PATH'] = shelve_time_path
        site = validate_site(site)
        Tango.shelve_by_name(site, modified_only=modified_only, logfile=sys.stdout)
        open(os.environ['SHELVE_TIME_PATH'], 'w').close()