# original version # import sys, re import SerialSubstitution from SerialSubstitution import AddProcessor, RunSubstitutor ################################################################################ if __name__ == "__main__": ############################################################################# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # CMakeLists.txt # Subst = AddProcessor(SerialSubstitution.ProcessorClass("cmake")) Subst.AddFileNamePattern("CMakeLists.txt") Subst.AddWord("sbndcode_Geo", "sbndcode_Geometry") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # C++ source code (including modules and services) # Subst = AddProcessor(SerialSubstitution.ProcessorClass("code")) Subst.AddFileType("h", "cc", "cpp", "cxx") Subst.AddWord("sbndcode/Geo/", "sbndcode/Geometry/") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#!/usr/bin/env python2 import sys, re import SerialSubstitution from SerialSubstitution import AddProcessor, RunSubstitutor ################################################################################ if __name__ == "__main__": ############################################################################# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # FHiCL configuration # Subst = AddProcessor(SerialSubstitution.ProcessorClass("FHiCL")) Subst.AddFileType("fcl") Subst.AddSimplePattern("LArProperties:", "LArPropertiesService:") Subst.AddSimplePattern(".LArProperties.", ".LArPropertiesService.") Subst.AddSimplePattern("DetectorProperties:", "DetectorPropertiesService:") Subst.AddSimplePattern(".DetectorProperties.", ".DetectorPropertiesService.") Subst.AddSimplePattern("TimeService:", "DetectorClocksService:") Subst.AddSimplePattern(".TimeService.", ".DetectorClocksService.") Subst.AddSimplePattern("timeservice", "detectorclocks") Subst.AddSimplePattern(".LArPropertiesService.Efield:", ".DetectorPropertiesService.Efield:") Subst.AddSimplePattern(".LArPropertiesService.Electronlifetime:", ".DetectorPropertiesService.Electronlifetime:") Subst.AddSimplePattern(".LArPropertiesService.Temperature:", ".DetectorPropertiesService.Temperature:") Subst.AddSimplePattern("IChannelStatusService:", "ChannelStatusService:")
#!/usr/bin/env python import sys, re import SerialSubstitution from SerialSubstitution import AddProcessor, RunSubstitutor ################################################################################ if __name__ == "__main__": ############################################################################# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # C++ source code # Subst = AddProcessor(SerialSubstitution.ProcessorClass("configuration")) Subst.AddFileType("fcl") # include files Subst.AddWord("icarus_basic_services", "icarus_common_services") Subst.AddWord("services_icarus.fcl", "services_common_icarus.fcl") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ############################################################################# sys.exit(RunSubstitutor()) #
#!/usr/bin/env python2 import sys, re import SerialSubstitution from SerialSubstitution import AddProcessor, RunSubstitutor ################################################################################ if __name__ == "__main__": ############################################################################# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # All files (no file selection) # Subst = AddProcessor(SerialSubstitution.ProcessorClass("FHiCL")) Subst.AddRegExRemoveLine(r"\s*user\s*:\s*\{\s*\}\s*") Subst.AddRegExPattern(r"user:(\s+)@local::", r" \1@table::") Subst.AddRegExPattern(r"user:(\s+)\{\s*(.*)\s*\}\s*", r"\2") Subst.AddSimplePattern("services.user.", "services.") Subst.AddWarningPattern(r"user\s*:", "Manual intervention may be required") # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ############################################################################# sys.exit(RunSubstitutor()) #