import time import os import pwd import errno import re import subprocess import signal import tempfile import random import glob from dogtail.config import config def scratchFile(label): """Uses tempfile.NamedTemporaryFile() to create a unique tempfile in config.scratchDir, with a filename like: dogtail-headless-