From 495751b00c463782726d06a524729bf7a1f59e24 Mon Sep 17 00:00:00 2001 From: Sam Ireland Date: Wed, 30 Dec 2020 22:28:50 +0000 Subject: [PATCH] Start save script --- .gitignore | 3 +++ save.py | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 .gitignore create mode 100755 save.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a5e00e --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pyc +__pycache__ +.DS_Store \ No newline at end of file diff --git a/save.py b/save.py new file mode 100755 index 0000000..cabdc84 --- /dev/null +++ b/save.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +import argparse +import os + +# Get arguments +parser = argparse.ArgumentParser(description="Save reddit posts to file.") +parser.add_argument("mode", type=str, nargs=1, choices=["saved", "upvoted"], help="The file to convert.") +parser.add_argument("location", type=str, nargs=1, help="The path to save to.") +args = parser.parse_args() +mode = args.mode[0] +location = args.location[0] + +# Is location specified a directory? +if not os.path.isdir(location): + print(location, "is not a directory") \ No newline at end of file