@@ -95,7 +95,7 @@ def wrapper(*args, **kwargs):
9595 return wrapper
9696
9797
98- @click .group (context_settings = dict ( help_option_names = ['-h' , '--help' ]) )
98+ @click .group (context_settings = { ' help_option_names' : ['-h' , '--help' ]} )
9999def main ():
100100 pass
101101
@@ -199,7 +199,7 @@ def list_tags():
199199
200200@main .command ("fetch-unread" )
201201@click .option ("-f" , "--folder" , required = True , help = 'Folder which articles belong to' )
202- @click .option ("-t" , "--tags" , help = "Tag(s) for filtering, seprate with comma" )
202+ @click .option ("-t" , "--tags" , help = "Tag(s) for filtering, separate with comma" )
203203@click .option ("-o" , "--outfile" , required = True , help = "Filename to save articles" )
204204@click .option (
205205 "--out-format" ,
@@ -270,7 +270,7 @@ def apply_action(articles, client, action, tags):
270270 elif action == 'broadcast' :
271271 client .broadcast (articles )
272272 for article in articles :
273- LOGGER .info ("Boradcast article: %s" , article .title )
273+ LOGGER .info ("Broadcast article: %s" , article .title )
274274 elif action == 'star' :
275275 client .mark_as_starred (articles )
276276 for article in articles :
@@ -362,7 +362,7 @@ def get_subscriptions(outfile, folder, out_format):
362362 client = get_client ()
363363 results = []
364364 for sub in client .get_subscription_list ():
365- sub_categories = set ([ category ['label' ] for category in sub .categories ])
365+ sub_categories = { category ['label' ] for category in sub .categories }
366366 if folder and folder not in sub_categories :
367367 continue
368368
@@ -452,9 +452,7 @@ def dedupe(folder, thresh):
452452 for docid , doc , _ in related :
453453 if docid == article .id :
454454 continue
455- sims [doc ] = sim_of (
456- doc , article .title , method = 'cosine' , term = 'char' , ngram_range = (2 , 3 )
457- )
455+ sims [doc ] = sim_of (doc , article .title , method = 'cosine' , term = 'char' , ngram_range = (2 , 3 ))
458456
459457 if sims and max (sims .values ()) >= thresh :
460458 top_doc , top_score = sims .most_common ()[0 ]
@@ -470,7 +468,7 @@ def dedupe(folder, thresh):
470468
471469@main .command ("fetch-starred" )
472470@click .option ("-f" , "--folder" , help = 'Folder which articles belong to' )
473- @click .option ("-t" , "--tags" , help = "Tag(s) for filtering, seprate with comma" )
471+ @click .option ("-t" , "--tags" , help = "Tag(s) for filtering, separate with comma" )
474472@click .option (
475473 "-o" , "--outfile" , help = "Filename to save articles, required when output format is `csv`"
476474)
@@ -587,10 +585,13 @@ def fetch_starred(folder, tags, outfile, outdir, limit, save_image, out_format):
587585
588586
589587@main .command ("edit-subscription" )
590- @click .option ("-a" , "--action" ,
591- required = True ,
592- type = click .Choice (['follow' , 'unfollow' , 'rename' , 'add-folder' , 'remove-folder' ]),
593- help = "" )
588+ @click .option (
589+ "-a" ,
590+ "--action" ,
591+ required = True ,
592+ type = click .Choice (['follow' , 'unfollow' , 'rename' , 'add-folder' , 'remove-folder' ]),
593+ help = "" ,
594+ )
594595@click .option ("-i" , "--stream-id" , required = True , help = 'Stream ID which you want to fetch' )
595596@click .option ("-n" , "--name" , help = 'The name of subscription, for action follow/rename(required)' )
596597@click .option ("-f" , "--folder" , help = 'Folder which subscription belong to' )
@@ -616,11 +617,7 @@ def edit_subscriptions(action, stream_id, name, folder):
616617 remove_folder = folder if action == 'remove-folder' else None
617618 try :
618619 response = client .edit_subscription (
619- stream_id ,
620- edit_action ,
621- title = name ,
622- add_folder = add_folder ,
623- remove_folder = remove_folder
620+ stream_id , edit_action , title = name , add_folder = add_folder , remove_folder = remove_folder
624621 )
625622 click .secho (response , fg = "green" )
626623 except Exception as exception :
0 commit comments