def sync_repo(self): ex_repo_files = get_repo_html_exercises() for repo_file in ex_repo_files: if not repo_file in self.ex_db_files: newex = Exercise(name=repo_file.replace(".html",""), file_name=repo_file) newex.live = False newex.put() logging.error("Add exercise from repo: %s" % repo_file) self.exs = Exercise.all().fetch(9999) self.ex_db_files = [ex.file_name for ex in self.exs] return True