def jsfy_dir(path, basedir, fout):
    if (not path.endswith('/')):
        path = (path + '/')
    fname = basename(path)
    if fname.startswith('.'):
        return
    if (not path.startswith(basedir)):
        return
    for f in listdir(path):
        subpath = join(path, f)
        if isfile(subpath):
            jsfy_file(subpath, basedir, fout)
        elif isdir(subpath):
            jsfy_dir(subpath, basedir, fout)
def jsfy_dir(path, basedir, fout):
    if (not path.endswith('/')):
        path = (path + '/')
    fname = basename(path)
    if fname.startswith('.'):
        return
    if (not path.startswith(basedir)):
        return
    for f in listdir(path):
        subpath = join(path, f)
        if isfile(subpath):
            jsfy_file(subpath, basedir, fout)
        elif isdir(subpath):
            jsfy_dir(subpath, basedir, fout)