@@ -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
@@ -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 ]
@@ -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