diff --git a/microblog.py b/microblog.py index ecb5bc2..258f33a 100644 --- a/microblog.py +++ b/microblog.py @@ -273,15 +273,19 @@ if __name__ == "__main__": p = argparse.ArgumentParser() p.add_argument("template", help="an html template file") p.add_argument("content", help="text file for microblog content") - p.add_argument("--sort", \ + p.add_argument("--sort", \ help="sorts content from oldest to newest" " (this is a separate operation from page generation)", \ action="store_true") + p.add_argument("--skip-fetch", \ + help="skips fetching profile data from remote sources;" + " has no effect if webring is not enabled",\ + action="store_true") args = p.parse_args() if args.sort: sort(args.content) exit() - return args.template, args.content + return args.template, args.content, args.skip_fetch # assume relative path def demote_css(template, css_list, level=1): @@ -476,7 +480,7 @@ if __name__ == "__main__": return render(list_of_json_objs, f_cfg["format"]) def main(): - tpl, content = get_args() + tpl, content, skip_fetch = get_args() cfg = load_settings() if cfg == None: print("exit: no settings.toml found.", file=sys.stderr) @@ -511,6 +515,7 @@ if __name__ == "__main__": if cfg["webring"]["enabled"] == True: export_profile( len(p), p[0].get_epoch_time(), cfg["webring"] ) + if not skip_fetch: fellows = fn1(cfg["webring"]["following"] ) if fellows != []: updated += writepage(