From 6b0dd554314ac71bc03b1414ee3de659c520e1ac Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 27 Jan 2020 18:53:19 -0800 Subject: [PATCH] Rename getstyles.py -> get_styles.py. --- timesearch_modules/__init__.py | 21 ++++++++++--------- .../{getstyles.py => get_styles.py} | 6 +++--- 2 files changed, 14 insertions(+), 13 deletions(-) rename timesearch_modules/{getstyles.py => get_styles.py} (91%) diff --git a/timesearch_modules/__init__.py b/timesearch_modules/__init__.py index bcc9170..5e61fe4 100644 --- a/timesearch_modules/__init__.py +++ b/timesearch_modules/__init__.py @@ -27,7 +27,7 @@ Commands for collecting: {get_submissions} {get_comments} {livestream} -{getstyles} +{get_styles} {getwiki} Commands for processing: @@ -92,11 +92,11 @@ get_comments: If provided, print extra information to the screen. ''', - 'getstyles': ''' -getstyles: + 'get_styles': ''' +get_styles: Collect the stylesheet, and css images. - > timesearch.py getstyles -r subredditname + > timesearch.py get_styles -r subredditname ''', 'getwiki': ''' @@ -268,6 +268,7 @@ get_submissions: OLD_COMMAND_ALIASES = { 'timesearch': 'get_submissions', 'commentaugment': 'get_comments', + 'getstyles': 'get_styles', 'redmash': 'index', } @@ -307,9 +308,9 @@ def get_comments_gateway(args): from . import get_comments get_comments.get_comments_argparse(args) -def getstyles_gateway(args): - from . import getstyles - getstyles.getstyles_argparse(args) +def get_styles_gateway(args): + from . import get_styles + get_styles.get_styles_argparse(args) def getwiki_gateway(args): from . import getwiki @@ -355,9 +356,9 @@ p_get_comments.add_argument('-l', '--lower', dest='lower', default='update') p_get_comments.add_argument('-up', '--upper', dest='upper', default=None) p_get_comments.set_defaults(func=get_comments_gateway) -p_getstyles = subparsers.add_parser('getstyles') -p_getstyles.add_argument('-r', '--subreddit', dest='subreddit') -p_getstyles.set_defaults(func=getstyles_gateway) +p_get_styles = subparsers.add_parser('get_styles', aliases=['getstyles']) +p_get_styles.add_argument('-r', '--subreddit', dest='subreddit') +p_get_styles.set_defaults(func=get_styles_gateway) p_getwiki = subparsers.add_parser('getwiki') p_getwiki.add_argument('-r', '--subreddit', dest='subreddit') diff --git a/timesearch_modules/getstyles.py b/timesearch_modules/get_styles.py similarity index 91% rename from timesearch_modules/getstyles.py rename to timesearch_modules/get_styles.py index 242f9ea..3193c52 100644 --- a/timesearch_modules/getstyles.py +++ b/timesearch_modules/get_styles.py @@ -5,7 +5,7 @@ from . import common from . import tsdb -def getstyles(subreddit): +def get_styles(subreddit): (database, subreddit) = tsdb.TSDB.for_subreddit(subreddit, fix_name=True) print('Getting styles for /r/%s' % subreddit) @@ -27,5 +27,5 @@ def getstyles(subreddit): response = requests.get(image['url']) image_file.write(response.content) -def getstyles_argparse(args): - return getstyles(args.subreddit) +def get_styles_argparse(args): + return get_styles(args.subreddit)