import os


def ordered_list_dir(dir):
    entries = os.listdir(dir)
    entries.sort()
    return entries


def ordered_list_json_dir(dir):
    return list(
        filter(lambda f: os.path.splitext(f)[1] == '.json',
               ['{}/{}'.format(dir, f) for f in ordered_list_dir(dir)]))
