Ejemplo n.º 1
0
#   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/")

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
if __name__ == "__main__":

    #############################################################################
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # FHiCL configuration
    #
    #Subst = AddProcessor(SerialSubstitution.ProcessorClass("FHiCL"))

    #Subst.AddFileType("fcl")

    #Subst.AddSimplePattern("LArProperties:",                          "LArPropertiesService:")

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # CMakeLists.txt
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("cmake"))

    Subst.AddFileNamePattern("CMakeLists.txt")

    # the only serviceable part was NameSelector
    Subst.AddWord("test_Geometry", "larcore_CoreUtils")
    #Subst.AddRegExRemoveLine(r"^\s*(LArProperties|DetectorProperties|DetectorClocks|TimeService)_service\s*(#.*)?$")

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # art module source code
    #
    #Subst = AddProcessor(SerialSubstitution.ProcessorClass("modules"))

    #Subst.AddFileNamePattern(".*_module\.cc")

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Ejemplo n.º 3
0
#   original version
#

import sys, re

import SerialSubstitution
from SerialSubstitution import AddProcessor, RunSubstitutor

################################################################################
if __name__ == "__main__":

    #############################################################################
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # FHiCL configuration
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("FHiCL"))

    Subst.AddFileType("fcl")

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # CMakeLists.txt
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("cmake"))

    Subst.AddFileNamePattern("CMakeLists.txt")

    # note that GeometryTestAlg was also moved, but it did not sport the product name header
    Subst.AddWord("larcore_Geometry", "larcorealg_Geometry")
    Subst.AddWord("larcore_CoreUtils", "larcorealg_CoreUtils")
    Subst.AddWord("larcore_TestUtils", "larcorealg_TestUtils")
Ejemplo n.º 4
0
#!/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())
#
Ejemplo n.º 6
0
#   added replacement for LARSIM_RANDOMUTILS_LARSEEDSERVICE_USExxx macros
#

import sys, re

import SerialSubstitution
from SerialSubstitution import AddProcessor, RunSubstitutor

################################################################################
if __name__ == "__main__":

    #############################################################################
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # FHiCL configuration
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("FHiCL"))

    Subst.AddFileType("fcl")

    Subst.AddWord("LArSeedService", "NuRandomService")
    Subst.AddWord("per_event_seedservice", "per_event_NuRandomService")
    Subst.AddWord("standard_seedservice", "standard_NuRandomService")
    Subst.AddWord("autoincrement_seedservice", "autoincrement_NuRandomService")
    Subst.AddWord("linearmapping_seedservice", "linearmapping_NuRandomService")
    Subst.AddWord("random_seedservice", "random_NuRandomService")
    Subst.AddWord("autoincrement_seedservice", "autoincrement_NuRandomService")

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # CMakeLists.txt
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("cmake"))
Ejemplo n.º 7
0
#   added replacement for LARSIM_RANDOMUTILS_LARSEEDSERVICE_USExxx macros
#

import sys, re

import SerialSubstitution
from SerialSubstitution import AddProcessor, RunSubstitutor

################################################################################
if __name__ == "__main__":

    #############################################################################
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # FHiCL configuration
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("FHiCL"))

    Subst.AddFileType("fcl")

    Subst.AddWord("SeedService", "LArSeedService")

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # CMakeLists.txt
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("cmake"))

    Subst.AddFileNamePattern("CMakeLists.txt")

    Subst.AddWord("artextensions_SeedService_service",
                  "larsim_RandomUtils_LArSeedService_service")
    Subst.AddWord("SeedService_service",
#!/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())
#
Ejemplo n.º 9
0
def intoLibraryPrefix(path):
    return path.replace('/', '_')


def intoHeaderGuardPrefix(path):
    return path.replace('/', '_').replace('.', '_').upper()


################################################################################
if __name__ == "__main__":

    #############################################################################
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # FHiCL configuration
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("FHiCL"))

    Subst.AddFileType("fcl")

    for rule in Substitutions.values():

        # this is for the rare cases where a plugin is specified by full path, e.g.
        # module_type: "icaruscode/Analysis/AnalysisTree";

        # if we have a list of plugins, we translate only those
        plugins = rule.get('plugins', [
            None,
        ])

        baseSrc = rule['source']
        baseDest = rule['dest']
Ejemplo n.º 10
0
#!/usr/bin/env python2

import sys, re

import SerialSubstitution
from SerialSubstitution import AddProcessor, RunSubstitutor

################################################################################
if __name__ == "__main__":

    #############################################################################
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # C++ source code
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("code"))

    Subst.AddFileType("h", "cc", "cpp", "cxx", "tcc")

    # include files
    Subst.AddWord("lardata/Utilities/StatCollector.h",
                  "lardataalg/Utilities/StatCollector.h")
    Subst.AddPattern('"StatCollector.h"',
                     '"lardataalg/Utilities/StatCollector.h"')

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    #############################################################################

    sys.exit(RunSubstitutor())
#
Ejemplo n.º 11
0
#!/usr/bin/env python2

import sys, re

import SerialSubstitution
from SerialSubstitution import AddProcessor, RunSubstitutor

################################################################################
if __name__ == "__main__":

    #############################################################################
    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # C++ source code
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("code"))

    Subst.AddFileType("h", "cc", "cpp", "cxx", "tcc")

    # include files
    Subst.AddWord("geo::MiddlePointAccumulator",
                  "geo::vect::MiddlePointAccumulator")
    Subst.AddWord("geo::vect::Normalize", "geo::vect::normalize")
    Subst.AddWord("geo::vect::Dot", "geo::vect::dot")
    Subst.AddWord("geo::vect::Cross", "geo::vect::cross")
    Subst.AddWord("geo::vect::MixedProduct", "geo::vect::mixedProduct")
    Subst.AddWord("geo::vect::Mag2", "geo::vect::mag2")
    Subst.AddWord("geo::vect::Rounded01", "geo::vect::rounded01")
    Subst.AddWord("geo::vect::Round01", "geo::vect::round01")
    Subst.AddWord("geo::vect::RoundValue01", "geo::vect::extra::roundValue01")

    Subst.AddWord("geo::vect::Vector_t", "geo::Vector_t")
Ejemplo n.º 12
0
#!/usr/bin/env python2

import sys, re

import SerialSubstitution
from SerialSubstitution import AddProcessor, RunSubstitutor

################################################################################
if __name__ == "__main__":

    # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
    # C++ source code
    #
    Subst = AddProcessor(SerialSubstitution.ProcessorClass("code"))

    Subst.AddFileType("h", "cc", "cpp", "cxx")

    # deprecated test macros
    Subst.AddWord("BOOST_MESSAGE", "BOOST_TEST_MESSAGE")
    Subst.AddWord("BOOST_CHECKPOINT", "BOOST_TEST_CHECKPOINT")
    Subst.AddWord("BOOST_BITWISE_EQUAL", "BOOST_CHECK_BITWISE_EQUAL")

    # BOOST_GLOBAL_FIXTURE macro became statement-like
    # (the first pattern is a special case of the second, where the line ends
    # after the pattern; the second pattern would replace the end-line with ';'
    # effectively killing one line)
    Subst.AddRegExPattern(r"(BOOST_GLOBAL_FIXTURE\((.*)\)[::space::]*)$",
                          r"\1;")
    Subst.AddRegExPattern(r"(BOOST_GLOBAL_FIXTURE\((.*)\)[::space::]*)[^;]",
                          r"\1;")