Skip to content

Commit c70fc87

Browse files
author
Zhaozhong Shi
committed
Remove Hard Coded Component and Make it to .hpsmc
1 parent c9cec31 commit c70fc87

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

python/hpsmc/tools.py

+18-4
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,24 @@ def __init__(self, **kwargs):
167167
"""!
168168
Initialize SQLiteProc to copy the SQLite file.
169169
"""
170-
171-
self.source_file = '/w/hallb-scshelf2102/hps/zshi/swiftjob/SQLite/LocalTest/hps_conditions_2025_03_06.sqlite'
172-
self.destination_file = './hps_conditions_2025_03_06.sqlite' # Modify this as needed
173-
170+
self.source_file = kwargs.get('source_file')
171+
self.destination_file = kwargs.get('destination_file')
172+
173+
#You can set this under for .hpsmc file to point to a specific local database. For me I used the following in .hpsmc
174+
#[EvioToLcio]
175+
#hps_java_bin_jar = /home/zshi/.m2/repository/org/hps/hps-distribution/5.2.2-SNAPSHOT/hps-distribution-5.2.2-SNAPSHOT-bin.jar
176+
#java_args = -Xmx3g -XX:+UseSerialGC -Dorg.sqlite.tmpdir=/w/hallb-scshelf2102/hps/zshi/swiftjob/SQLite/LocalTest/tmp/ -Dorg.hps.conditions.url=jdbc:sqlite:hps_conditions_2025_03_06.sqlite
177+
#[SQLiteProc]
178+
#source_file = /w/hallb-scshelf2102/hps/zshi/swiftjob/SQLite/LocalTest/hps_conditions_2025_03_06.sqlite
179+
#destination_file = ./hps_conditions_2025_03_06.sqlite
180+
181+
182+
if self.source_file is not None:
183+
self.logger.debug("Setting SQLite local copy source file from config: %s" + self.source_file)
184+
args.append(self.source_file)
185+
if self.destination_file is not None:
186+
self.logger.debug('Setting Job Destination file from config: %s' % self.destination_file)
187+
args.append('-Dorg.hps.conditions.url=%s' % self.destination_file)
174188

175189
# Ensure to call the parent constructor properly
176190
Component.__init__(self, name='sqlite_file_copy', **kwargs)

0 commit comments

Comments
 (0)