reddit_bot.py
def parse_args():
    """A helper function to parse command line arguments."""

    parser = argparse.ArgumentParser(description='Reddit submission daily highlights command line arguments')

    parser.add_argument('--reddit_config', metavar='CONFIG',  type=str, required=True, 
                        help='specify config section for Reddit config file, e.g. praw.ini')
    parser.add_argument('--subreddits', nargs='*', type=str, metavar='STRING', required=True, 
                        help='A list of subreddits')
    
    parser.add_argument('--limit', metavar='INT', type=int, default=10,
                        help='maximum num of posts per subreddit')
    parser.add_argument('--score', metavar='INT', type=int, default=50,
                        help='minimun score on a particular submission')
    parser.add_argument('--num_comments', metavar='INT', type=int, default=20,
                        help='minimun num of comments on a particular submission')

    parser.add_argument('--from_address', type=str, metavar='EMAIL', required=True, 
                        help='email addr from which to send contents')
    parser.add_argument('--from_address_pass', type=str, metavar='EMAIL_PASS', required=True, 
                        help='password for email addr from which to send contents')
    parser.add_argument('--to_address', nargs='*', type=str, metavar='EMAIL', required=True, 
                        help='email addr to which to send contents')

    args = parser.parse_args()
    logger.debug(args)

    return args
A helper function to parse command line arguments.
A helper function to parse command line arguments.
A helper function to parse command line arguments .
def parse_args():
    parser = argparse.ArgumentParser(description='Reddit submission daily highlights command line arguments')
    parser.add_argument('--reddit_config', metavar='CONFIG',  type=str, required=True, 
                        help='specify config section for Reddit config file, e.g. praw.ini')
    parser.add_argument('--subreddits', nargs='*', type=str, metavar='STRING', required=True, 
                        help='A list of subreddits')
    parser.add_argument('--limit', metavar='INT', type=int, default=10,
                        help='maximum num of posts per subreddit')
    parser.add_argument('--score', metavar='INT', type=int, default=50,
                        help='minimun score on a particular submission')
    parser.add_argument('--num_comments', metavar='INT', type=int, default=20,
                        help='minimun num of comments on a particular submission')
    parser.add_argument('--from_address', type=str, metavar='EMAIL', required=True, 
                        help='email addr from which to send contents')
    parser.add_argument('--from_address_pass', type=str, metavar='EMAIL_PASS', required=True, 
                        help='password for email addr from which to send contents')
    parser.add_argument('--to_address', nargs='*', type=str, metavar='EMAIL', required=True, 
                        help='email addr to which to send contents')
    args = parser.parse_args()
    logger.debug(args)
    return args
def parse_args ( ) : parser = argparse . ArgumentParser ( description = 'Reddit submission daily highlights command line arguments' ) parser . add_argument ( '--reddit_config' , metavar = 'CONFIG' , type = str , required = True , help = 'specify config section for Reddit config file, e.g. praw.ini' ) parser . add_argument ( '--subreddits' , nargs = '*' , type = str , metavar = 'STRING' , required = True , help = 'A list of subreddits' ) parser . add_argument ( '--limit' , metavar = 'INT' , type = int , default = 10 , help = 'maximum num of posts per subreddit' ) parser . add_argument ( '--score' , metavar = 'INT' , type = int , default = 50 , help = 'minimun score on a particular submission' ) parser . add_argument ( '--num_comments' , metavar = 'INT' , type = int , default = 20 , help = 'minimun num of comments on a particular submission' ) parser . add_argument ( '--from_address' , type = str , metavar = 'EMAIL' , required = True , help = 'email addr from which to send contents' ) parser . add_argument ( '--from_address_pass' , type = str , metavar = 'EMAIL_PASS' , required = True , help = 'password for email addr from which to send contents' ) parser . add_argument ( '--to_address' , nargs = '*' , type = str , metavar = 'EMAIL' , required = True , help = 'email addr to which to send contents' ) args = parser . parse_args ( ) logger . debug ( args ) return args
A helper function to parse command line arguments.
A helper function to parse command line arguments .
"""A helper function to parse command line arguments."""