def get_objects(self, **kwargs): news_file = current_app.config["LOCAL_DIR"] / self.d["news_html"] archived_news_file = (current_app.config["LOCAL_DIR"] / self.d["news_archive_html"]) news = local_info.read_html(news_file) archived_news = local_info.read_html(archived_news_file) return dict(news=news, archived_news=archived_news)
def get_objects(self, **kwargs): news_file = os.path.join(current_app.config["LOCAL_DIR"], self.d['news_html']) archived_news_file = os.path.join(current_app.config["LOCAL_DIR"], self.d['news_archive_html']) news = local_info.read_html(news_file) archived_news = local_info.read_html(archived_news_file) return dict(news=news, archived_news=archived_news)
def skeleton_variables(): update_ts_file = os.path.join(app.config['CACHE_DIR'], 'last-update') last_update = local_info.read_update_ts(update_ts_file) packages_prefixes = PackageName.get_packages_prefixes( app.config["CACHE_DIR"]) credits_file = os.path.join(app.config["LOCAL_DIR"], "credits.html") credits = local_info.read_html(credits_file) return dict(packages_prefixes=packages_prefixes, searchform=SearchForm(), last_update=last_update, credits=credits)
def skeleton_variables(): update_ts_file = os.path.join(app.config['CACHE_DIR'], 'last-update') # TODO, this part should be moved to per blueprint context processor last_update = local_info.read_update_ts(update_ts_file) packages_prefixes = qry.pkg_names_get_packages_prefixes( app.config["CACHE_DIR"]) credits_file = os.path.join(app.config["LOCAL_DIR"], "credits.html") credits = local_info.read_html(credits_file) return dict(packages_prefixes=packages_prefixes, searchform=SearchForm(), last_update=last_update, credits=credits)
def skeleton_variables(): update_ts_file = os.path.join(app.config['CACHE_DIR'], 'last-update') # TODO, this part should be moved to per blueprint context processor last_update = local_info.read_update_ts(update_ts_file) packages_prefixes = qry.pkg_names_get_packages_prefixes( app.config["CACHE_DIR"]) credits_file = os.path.join(app.config["LOCAL_DIR"], "credits.html") credits = local_info.read_html(credits_file) return dict(packages_prefixes=packages_prefixes, searchform=SearchForm(), last_update=last_update, credits=credits, name=app.import_name)
def index(): news_file = os.path.join(app.config["LOCAL_DIR"], "news.html") news = local_info.read_html(news_file) return render_template('index.html', news=news)