Skip to content

Commit

Permalink
Moved modules.py out of edmWriteConfig
Browse files Browse the repository at this point in the history
- is now a file in the template directory
- modification of scram  will use the new file and place in the
correct directory.
  • Loading branch information
Dr15Jones committed Mar 13, 2024
1 parent 980274e commit c374f9c
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 c374f9c

Please sign in to comment.