Skip to content

Commit

Permalink
Merge pull request #44396 from Dr15Jones/modulesTemplate
Browse files Browse the repository at this point in the history
Moved modules.py out of edmWriteConfig
  • Loading branch information
cmsbuild authored Mar 22, 2024
2 parents e4255f6 + c374f9c commit 58d132a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
17 changes: 0 additions & 17 deletions FWCore/ParameterSet/bin/edmWriteConfigs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,20 +135,6 @@ namespace {
pluginNames.push_back(nameAndType.first);
}
}

void writeModulesFile() {
if (std::filesystem::exists(std::filesystem::current_path() / "modules.py"))
return;
std::array<char, L_tmpnam> buffer;
std::tmpnam(buffer.data());
std::ofstream file{buffer.data()};

file << "from FWCore.ParameterSet.ModulesProxy import _setupProxies\n"
"locals().update(_setupProxies(__file__))\n";
file.close();
std::filesystem::copy(buffer.data(), "modules.py");
std::filesystem::remove(buffer.data());
}
} // namespace

int main(int argc, char** argv) try {
Expand Down Expand Up @@ -303,9 +289,6 @@ int main(int argc, char** argv) try {

std::set<std::string> usedCfiFileNames;
edm::for_all(pluginNames, std::bind(&writeCfisForPlugin, _1, factory, std::ref(usedCfiFileNames)));
if (not pluginNames.empty()) {
writeModulesFile();
}
});
} catch (cms::Exception& iException) {
if (!library.empty()) {
Expand Down
2 changes: 2 additions & 0 deletions FWCore/ParameterSet/templates/modules.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from FWCore.ParameterSet.ModulesProxy import _setupProxies
locals().update(_setupProxies(__file__))

0 comments on commit 58d132a

Please sign in to comment.