Rename commentaugment.py -> get_comments.py.

master
Ethan Dalool 2020-01-27 18:41:58 -08:00
parent 75648343e2
commit 744dadd3ee
2 changed files with 22 additions and 21 deletions

View File

@ -17,7 +17,7 @@ The basics:
> timesearch.py get_submissions -r subredditname > timesearch.py get_submissions -r subredditname
2. Collect the comments for those submissions 2. Collect the comments for those submissions
> timesearch.py commentaugment -r subredditname > timesearch.py get_comments -r subredditname
3. Stay up-to-date 3. Stay up-to-date
> timesearch.py livestream -r subredditname > timesearch.py livestream -r subredditname
@ -25,7 +25,7 @@ The basics:
Commands for collecting: Commands for collecting:
{get_submissions} {get_submissions}
{commentaugment} {get_comments}
{livestream} {livestream}
{getstyles} {getstyles}
{getwiki} {getwiki}
@ -63,12 +63,12 @@ breakdown:
Sort the output. Sort the output.
''', ''',
'commentaugment': ''' 'get_comments': '''
commentaugment: get_comments:
Collect comments on a subreddit or comments made by a user. Collect comments on a subreddit or comments made by a user.
> timesearch.py commentaugment -r subredditname <flags> > timesearch.py get_comments -r subredditname <flags>
> timesearch.py commentaugment -u username <flags> > timesearch.py get_comments -u username <flags>
flags: flags:
-s "t3_xxxxxx" | --specific "t3_xxxxxx": -s "t3_xxxxxx" | --specific "t3_xxxxxx":
@ -267,6 +267,7 @@ get_submissions:
OLD_COMMAND_ALIASES = { OLD_COMMAND_ALIASES = {
'timesearch': 'get_submissions', 'timesearch': 'get_submissions',
'commentaugment': 'get_comments',
} }
@ -301,9 +302,9 @@ def breakdown_gateway(args):
from . import breakdown from . import breakdown
breakdown.breakdown_argparse(args) breakdown.breakdown_argparse(args)
def commentaugment_gateway(args): def get_comments_gateway(args):
from . import commentaugment from . import get_comments
commentaugment.commentaugment_argparse(args) get_comments.get_comments_argparse(args)
def getstyles_gateway(args): def getstyles_gateway(args):
from . import getstyles from . import getstyles
@ -343,15 +344,15 @@ p_breakdown.add_argument('-r', '--subreddit', dest='subreddit', default=None)
p_breakdown.add_argument('-u', '--user', dest='username', default=None) p_breakdown.add_argument('-u', '--user', dest='username', default=None)
p_breakdown.set_defaults(func=breakdown_gateway) p_breakdown.set_defaults(func=breakdown_gateway)
p_commentaugment = subparsers.add_parser('commentaugment') p_get_comments = subparsers.add_parser('get_comments', aliases=['commentaugment'])
p_commentaugment.add_argument('-r', '--subreddit', dest='subreddit', default=None) p_get_comments.add_argument('-r', '--subreddit', dest='subreddit', default=None)
p_commentaugment.add_argument('-s', '--specific', dest='specific_submission', default=None) p_get_comments.add_argument('-s', '--specific', dest='specific_submission', default=None)
p_commentaugment.add_argument('-u', '--user', dest='username', default=None) p_get_comments.add_argument('-u', '--user', dest='username', default=None)
p_commentaugment.add_argument('-v', '--verbose', dest='verbose', action='store_true') p_get_comments.add_argument('-v', '--verbose', dest='verbose', action='store_true')
p_commentaugment.add_argument('--dont_supplement', dest='do_supplement', action='store_false') p_get_comments.add_argument('--dont_supplement', dest='do_supplement', action='store_false')
p_commentaugment.add_argument('-l', '--lower', dest='lower', default='update') p_get_comments.add_argument('-l', '--lower', dest='lower', default='update')
p_commentaugment.add_argument('-up', '--upper', dest='upper', default=None) p_get_comments.add_argument('-up', '--upper', dest='upper', default=None)
p_commentaugment.set_defaults(func=commentaugment_gateway) p_get_comments.set_defaults(func=get_comments_gateway)
p_getstyles = subparsers.add_parser('getstyles') p_getstyles = subparsers.add_parser('getstyles')
p_getstyles.add_argument('-r', '--subreddit', dest='subreddit') p_getstyles.add_argument('-r', '--subreddit', dest='subreddit')

View File

@ -6,7 +6,7 @@ from . import pushshift; print('Thank you Jason Baumgartner, owner of Pushshift.
from . import tsdb from . import tsdb
def commentaugment( def get_comments(
subreddit=None, subreddit=None,
username=None, username=None,
specific_submission=None, specific_submission=None,
@ -99,11 +99,11 @@ def commentaugment(
cur.execute(query, bindings) cur.execute(query, bindings)
database.sql.commit() database.sql.commit()
def commentaugment_argparse(args): def get_comments_argparse(args):
if args.verbose: if args.verbose:
common.log.setLevel(common.logging.DEBUG) common.log.setLevel(common.logging.DEBUG)
return commentaugment( return get_comments(
subreddit=args.subreddit, subreddit=args.subreddit,
username=args.username, username=args.username,
#limit=common.int_none(args.limit), #limit=common.int_none(args.limit),