Start save script

This commit is contained in:
Sam Ireland 2020-12-30 22:28:50 +00:00
commit 495751b00c
2 changed files with 19 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*.pyc
__pycache__
.DS_Store

16
save.py Executable file
View File

@ -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")