Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chg: dev: add program version. #42

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions export_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
import praw


__version__ = '0.1.1'


# # Converter class from https://gist.github.com/raphaa/1327761
class Converter():
"""Converts a CSV instapaper export to a Chrome bookmark file."""
Expand Down Expand Up @@ -95,6 +98,7 @@ def get_args(argv):
action="store_true")
parser.add_argument("-all", "--all", help="get upvoted, saved, comments and submissions",
action="store_true")
parser.add_argument("-V", "--version", help="get program version.", action="store_true")

args = parser.parse_args(argv)
return args
Expand Down Expand Up @@ -302,6 +306,10 @@ def main():
# set logging config
if args.verbose:
logging.basicConfig(level=logging.DEBUG)
# print program version.
if args.version:
print(__version__)
return

reddit = login(args=args)
if args.upvoted:
Expand Down
4 changes: 3 additions & 1 deletion tests/test_export_saved.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
{
'all': False, 'upvoted': False, 'verbose': False,
'client_secret': None, 'password': None,
'username': None, 'client_id': None
'username': None, 'client_id': None,
'version': False
}
)]
)
Expand Down Expand Up @@ -173,6 +174,7 @@ def test_main(verbose, upvoted, all):
verbose=verbose,
upvoted=upvoted,
all=all,
version=False
)
import export_saved
# run
Expand Down