On first invocation, creates a temporary directory and returns its
    path. Subsequent invocations uses the same directory.

    :returns: A temporary directory created for this run of glerbl.
    :rtype: :class:`str`

def get_tmpdir():
    """
    On first invocation, creates a temporary directory and returns its
    path. Subsequent invocations uses the same directory.

    :returns: A temporary directory created for this run of glerbl.
    :rtype: :class:`str`
    """
    global __tmpdir
    if __tmpdir is not None:
        return __tmpdir

    __tmpdir = tempfile.mkdtemp(prefix='.tmp.glerbl.', dir=".")
    atexit.register(__clean_tmpdir)

    return __tmpdir