@@ -90,22 +90,11 @@ def plugins():
9090    pass 
9191
9292
93- # The private group holds commands that should never be called by the user 
94- # since they are used internally by Qiita to be able to distribute compute 
95- @qiita .group () 
96- def  private ():
97-     pass 
98- 
99- 
10093@ware .group () 
10194def  ebi ():
10295    pass 
10396
10497
105- @db .group () 
106- def  portal ():
107-     pass 
108- 
10998# ############################################################################# 
11099# DB COMMANDS 
111100# ############################################################################# 
@@ -165,23 +154,6 @@ def load_artifact(fp, fp_type, artifact_type, prep_template, parents,
165154    click .echo ("Artifact %s successfully created"  %  artifact .id )
166155
167156
168- @db .command () 
169- @click .option ('--fp' , required = True , type = click .Path (resolve_path = True , 
170-               readable = True , exists = True ), multiple = True , 
171-               help = 'Path to the artifact files. This option can be used '  
172-               'multiple times if there are multiple artifact files.' ) 
173- @click .option ('--fp_type' , required = True , multiple = True , help = 'Describes the '  
174-               'contents of the file. Pass one fp_type per fp.' , 
175-               type = click .Choice (qdb .util .get_filepath_types ().keys ())) 
176- @click .option ('--artifact_id' , required = True , 
177-               help = "The artifact to update" , 
178-               type = click .IntRange (1 )) 
179- def  update_artifact (fp , fp_type , artifact_id ):
180-     """Updates an artifact from the database""" 
181-     artifact  =  qdb .commands .update_artifact_from_cmd (fp , fp_type , artifact_id )
182-     click .echo ("Artifact %s successfully updated"  %  artifact .id )
183- 
184- 
185157@db .command () 
186158@click .argument ('fp' , required = True , 
187159                type = click .Path (resolve_path = True , readable = True , exists = True )) 
@@ -210,96 +182,10 @@ def load_prep_template(fp, study, data_type):
210182               %  prep_template .id )
211183
212184
213- @db .command () 
214- @click .option ('--name' , required = True , type = str , 
215-               help = 'The name of the new reference database' ) 
216- @click .option ('--version' , required = True , type = str , 
217-               help = 'The version of the reference database' ) 
218- @click .option ('--seq_fp' , required = True , 
219-               type = click .Path (resolve_path = True , readable = True , exists = True ), 
220-               help = "Path to the reference sequences file" ) 
221- @click .option ('--tax_fp' , required = False , 
222-               type = click .Path (resolve_path = True , readable = True , exists = True ), 
223-               help = "Path to the reference taxonomy file" ) 
224- @click .option ('--tree_fp' , required = False , 
225-               type = click .Path (resolve_path = True , readable = True , exists = True ), 
226-               help = "Path to the reference tree file" ) 
227- def  load_reference_db (name , version , seq_fp , tax_fp , tree_fp ):
228-     """Loads a reference db to the database""" 
229-     reference  =  qdb .reference .Reference .create (
230-         name , version , seq_fp , tax_fp , tree_fp )
231-     click .echo ("Reference db successfully added to the database with id %s" 
232-                %  reference .id )
233- 
234- 
235- @db .command () 
236- @click .argument ('fp' , required = True , 
237-                 type = click .Path (resolve_path = True , readable = True , exists = True )) 
238- @click .option ('--cmd-id' , required = True , 
239-               type = click .IntRange (1 , None ), 
240-               help = 'The command to add the parameter set' ) 
241- @click .option ('--name' , required = True , type = str , 
242-               help = 'The name of the parameters set' ) 
243- def  load_parameters (fp , cmd_id , name ):
244-     """Loads a parameter set to the database""" 
245-     param  =  qdb .commands .load_parameters_from_cmd (name , fp , cmd_id )
246-     click .echo ("Parameters successfully added to the command %s with id %s" 
247-                %  (cmd_id , param .id ))
248- 
249- 
250- # ############################################################################# 
251- # PORTAL COMMANDS 
252- # ############################################################################# 
253- 
254- 
255- @portal .command (name = "add-analyses" ) 
256- @click .argument ('portal' , required = True , 
257-                 type = click .Choice (qdb .portal .Portal .list_portals ())) 
258- @click .argument ('analyses' , required = True , type = int , nargs = - 1 ) 
259- def  add_analysis (portal , analyses ):
260-     try :
261-         qdb .portal .Portal (portal ).add_analyses (analyses )
262-     except  qdb .exceptions .QiitaDBError  as  e :
263-         raise  click .BadOptionUsage ("analyses" , str (e ))
264- 
265- 
266- @portal .command (name = "remove-analyses" ) 
267- @click .argument ('portal' , required = True , 
268-                 type = click .Choice (qdb .portal .Portal .list_portals ())) 
269- @click .argument ('analyses' , required = True , type = int , nargs = - 1 ) 
270- def  remove_analysis (portal , analyses ):
271-     try :
272-         qdb .portal .Portal (portal ).remove_analyses (analyses )
273-     except  qdb .exceptions .QiitaDBError  as  e :
274-         raise  click .BadOptionUsage ("analyses" , str (e ))
275- 
276- 
277- @portal .command (name = "add-studies" ) 
278- @click .argument ('portal' , required = True , 
279-                 type = click .Choice (qdb .portal .Portal .list_portals ())) 
280- @click .argument ('studies' , required = True , type = int , nargs = - 1 ) 
281- def  add_study (portal , studies ):
282-     try :
283-         qdb .portal .Portal (portal ).add_studies (studies )
284-     except  qdb .exceptions .QiitaDBError  as  e :
285-         raise  click .BadOptionUsage ("studies" , str (e ))
286- 
287- 
288- @portal .command (name = "remove-studies" ) 
289- @click .argument ('portal' , required = True , 
290-                 type = click .Choice (qdb .portal .Portal .list_portals ())) 
291- @click .argument ('studies' , required = True , type = int , nargs = - 1 ) 
292- def  remove_study (portal , studies ):
293-     try :
294-         qdb .portal .Portal (portal ).remove_studies (studies )
295-     except  qdb .exceptions .QiitaDBError  as  e :
296-         raise  click .BadOptionUsage ("studies" , str (e ))
297- 
298185# ############################################################################# 
299186# EBI COMMANDS 
300187# ############################################################################# 
301188
302- 
303189@ebi .command () 
304190@click .option ('--preprocessed_data_id' , required = True , type = int ) 
305191@click .option ('--action' , type = click .Choice (EBISubmission .valid_ebi_actions ), 
@@ -317,21 +203,6 @@ def submit(preprocessed_data_id, action, send):
317203# MAINTENANCE COMMANDS 
318204# ############################################################################# 
319205
320- 
321- @maintenance .command () 
322- @click .option ('--time' , required = True , type = int , 
323-               help = 'The amount of time to lock the site, in hours' ) 
324- @click .option ('--message' , required = True , type = str , 
325-               help = "Message to show users" ) 
326- def  lock (message , time ):
327-     r_client .setex ('maintenance' , message , time  *  60  *  60 )
328- 
329- 
330- @maintenance .command () 
331- def  unlock ():
332-     r_client .delete ('maintenance' )
333- 
334- 
335206@maintenance .command () 
336207@click .option ('--time' , required = True , type = int , 
337208              help = 'The amount of time to show message, in hours' ) 
@@ -355,16 +226,8 @@ def clear_sysmessage():
355226
356227@maintenance .command () 
357228def  status ():
358-     maint_status  =  r_client .get ('maintenance' )
359229    sys_status  =  r_client .get ('sysmessage' )
360230
361-     if  maint_status  is  None :
362-         click .echo ("Site is not in maintenance mode" )
363-     else :
364-         click .echo ("Site is in maintenance mode:" )
365-         click .echo (maint_status )
366-         click .echo (r_client .ttl ('maintenance' ), "seconds remaining" )
367- 
368231    if  sys_status  is  None :
369232        click .echo ("Site has no system message" )
370233    else :
0 commit comments