def cli(ctx, user, limit): if ctx.invoked_subcommand is None: Filter(async_mode=True).main_menu() elif ctx.invoked_subcommand == 'login': # Does not create the Filter object when login, cause there's no credentials that can be used. pass elif user and limit: ctx.obj = Filter(user, limit) elif user: ctx.obj = Filter(user=user) elif limit: ctx.obj = Filter(limit=limit) else: ctx.obj = Filter()
def search_comments(ctx: Filter, query): matched = ctx.search_comments(query) ctx.parse_content(matched)
def subreddits(ctx: Filter, subs): matched = ctx.get_subreddit([x.lower() for x in subs]) ctx.parse_content(matched)
def filter_media(ctx: Filter, media_type): matched = ctx.get_media(media_type) ctx.parse_content(matched)
def text_only(ctx: Filter): matched = ctx.get_self() ctx.parse_content(matched)
def comments(ctx: Filter): matched = ctx.get_comments() ctx.parse_content(matched)
def posts(ctx: Filter): matched = ctx.get_posts() ctx.parse_content(matched)
def show_all(ctx: Filter): matched = ctx.get_all() ctx.parse_content(matched)
def external_links(ctx: Filter): matched = ctx.get_external_links() ctx.parse_content(matched)
def get_nsfw(ctx: Filter): matched = ctx.get_nsfw() ctx.parse_content(matched)