def main(options, logger=None): if logger == None: logger = Logger("download.log", "download.py", True, True) else: logger.context = "download.py" try: query = utils.getQuery() logger.context = "download.py" if __name__ == "__main__": utils.log_header(logger, DESCRIPTION, options.get("verbose", False)) logger.debug("Options:", options.get("verbose", False)) for i in options: logger.debug(i + ": " + str(options[i]), options.get("verbose", False)) download_query(query, options, logger) # move all downloaded videos in videos directory repoDir = utils.repoPath() fs = os.listdir(repoDir) for f in fs: if utils.is_video(f): os.rename(f, "videos/" + f) logger.success("All files downloaded.", not options.get("silent", False)) except Exception as e: logger.handle_exception(e) raise e
def answer(query): s = utils.getQuery(query) return render_template("answer.html",ans=s)
def getQuery(request): """Return formatted query for sessions.""" return utils.getQuery(request, models.Session)
def getQuery(request): """Return formatted query for conferences.""" return utils.getQuery(request, models.Conference)