def open_repository(cls, path): regex = re.compile('/([A-Za-z0-9]+).git') results = regex.findall(path) name = results[0] return Repo(name)