Example #1
0
def get_layout_history(session, layout):
    layhist = LayoutHistory()

    for f in glob.glob(os.path.join(tdir_u, 'L*')):
        stats = os.stat(f)
        lastmod_date = time.localtime(stats.st_mtime)
        date_file_tuple = (lastmod_date, f)
        layhist.undo.append(date_file_tuple)
    layhist.undo.sort(reverse = True)
    
    n_undo = []
    for (i,e) in enumerate(layhist.undo):
        d,f = e
        if i >= HISTLEN:
            removeit(f)
        else:
            n_undo.append((d,f))
    layhist.undo = n_undo

    for f in glob.glob(os.path.join(tdir_r, 'L*')):
        stats = os.stat(f)
        lastmod_date = time.localtime(stats.st_mtime)
        date_file_tuple = (lastmod_date, f)
        layhist.redo.append(date_file_tuple)
    layhist.redo.sort(reverse = True)

    layhist.current = glob.glob(os.path.join(tdir, 'L*'))
    return layhist



    pass
Example #2
0
def cleanup():
    for tdir in dumpscreen_window_dirs:
        removeit(tdir)

    # remove old files in "___source" directory
    import glob
    import time
    now = time.time()
    for f in glob.glob(os.path.join(tmpdir_source, '*')):
        if now - os.stat(f).st_mtime > 30:
            remove(f)
Example #3
0
def cleanup():
    for tdir in dumpscreen_window_dirs:
        removeit(tdir)

    # remove old files in "___source" directory
    import glob
    import time
    now = time.time()
    for f in glob.glob(os.path.join(tmpdir_source, '*')):
        if now - os.stat(f).st_mtime > 30:
            remove(f)