File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -140,12 +140,13 @@ def config_join(*args):
140
140
preseeded_database = True
141
141
master_api_key = kwds .get ("master_api_key" , "test_key" )
142
142
dependency_dir = os .path .join (config_directory , "deps" )
143
-
143
+ galaxy_sqlite_database = kwds . get ( "galaxy_sqlite_database" , None )
144
144
try :
145
145
_download_database_template (
146
146
galaxy_root ,
147
147
database_location ,
148
- latest = latest_galaxy
148
+ latest = latest_galaxy ,
149
+ galaxy_sqlite_database = galaxy_sqlite_database ,
149
150
)
150
151
except Exception as e :
151
152
print (e )
@@ -358,7 +359,16 @@ def cleanup(self):
358
359
shutil .rmtree (self .config_directory )
359
360
360
361
361
- def _download_database_template (galaxy_root , database_location , latest = False ):
362
+ def _download_database_template (
363
+ galaxy_root ,
364
+ database_location ,
365
+ latest = False ,
366
+ galaxy_sqlite_database = None
367
+ ):
368
+ if galaxy_sqlite_database is not None :
369
+ shutil .copyfile (galaxy_sqlite_database , database_location )
370
+ return True
371
+
362
372
if latest :
363
373
template_url = DOWNLOADS_URL + urlopen (LATEST_URL ).read ()
364
374
urlretrieve (template_url , database_location )
Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ def galaxy_root_option():
42
42
)
43
43
44
44
45
+ def galaxy_sqlite_database_option ():
46
+ return click .option (
47
+ "--galaxy_sqlite_database" ,
48
+ callback = get_default_callback (None , resolve_path = True ),
49
+ type = click .Path (exists = True , file_okay = False , resolve_path = True ),
50
+ help = "Preseeded Galaxy sqlite database to target." ,
51
+ )
52
+
53
+
45
54
def galaxy_cwl_root_option ():
46
55
return click .option (
47
56
"--cwl_galaxy_root" ,
@@ -521,6 +530,7 @@ def galaxy_config_options():
521
530
def galaxy_target_options ():
522
531
return _compose (
523
532
galaxy_root_option (),
533
+ galaxy_sqlite_database_option (),
524
534
install_galaxy_option (),
525
535
no_cache_galaxy_option (),
526
536
no_cleanup_option (),
You can’t perform that action at this time.
0 commit comments