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):
140140 preseeded_database = True
141141 master_api_key = kwds .get ("master_api_key" , "test_key" )
142142 dependency_dir = os .path .join (config_directory , "deps" )
143-
143+ galaxy_sqlite_database = kwds . get ( "galaxy_sqlite_database" , None )
144144 try :
145145 _download_database_template (
146146 galaxy_root ,
147147 database_location ,
148- latest = latest_galaxy
148+ latest = latest_galaxy ,
149+ galaxy_sqlite_database = galaxy_sqlite_database ,
149150 )
150151 except Exception as e :
151152 print (e )
@@ -358,7 +359,16 @@ def cleanup(self):
358359 shutil .rmtree (self .config_directory )
359360
360361
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+
362372 if latest :
363373 template_url = DOWNLOADS_URL + urlopen (LATEST_URL ).read ()
364374 urlretrieve (template_url , database_location )
Original file line number Diff line number Diff line change @@ -42,6 +42,15 @@ def galaxy_root_option():
4242 )
4343
4444
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+
4554def galaxy_cwl_root_option ():
4655 return click .option (
4756 "--cwl_galaxy_root" ,
@@ -521,6 +530,7 @@ def galaxy_config_options():
521530def galaxy_target_options ():
522531 return _compose (
523532 galaxy_root_option (),
533+ galaxy_sqlite_database_option (),
524534 install_galaxy_option (),
525535 no_cache_galaxy_option (),
526536 no_cleanup_option (),
You can’t perform that action at this time.
0 commit comments