def get(slug): path = get_path(slug, 'info') if not os.path.exists(path): raise GroupNotFound(slug) with open(get_path(slug, 'info')) as fp: group = Group(json.load(fp)) group.slug = slug return group
def ensure_dir(*c): path = get_path(*c) try: os.mkdir(path) except: if not os.path.exists(path): raise return path
def get_path(self, *c): return get_path(self.slug, *c)