CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions | Variables
linker Namespace Reference

Functions

def filter
 
def findMatchingFiles
 
def getLink
 
def process
 
def replace
 

Variables

string BASE = "/cmsdoxygen/"
 
list DIR = sys.argv[1]
 
tuple files = output.read()
 
list h_source_htmls = []
 
int i = 0
 
dictionary INDEX = {}
 
tuple output = os.popen(query)
 
 printOutput = False;
 
list py_source_htmls = []
 
string query = "find "
 

Function Documentation

def linker.filter (   s,
  w,
  k 
)

Definition at line 23 of file linker.py.

Referenced by getLink().

23 
24 def filter(s,w,k):
25  o = s.split()
26  if len(o) > 1:
27  betterChoice = ""
28  for i in range(len(o)):
29  if re.search("[^a-zA-Z]"+w+"[^a-zA-Z]", o[i]):
30  if re.search(".*"+k+".*",o[i]):
31  return o[i]
32  else:
33  if betterChoice == "" or len(betterChoice) > o[i]:
34  betterChoice = o[i]
35  return betterChoice
36  else:
37  if re.search("[^a-zA-Z]"+w+"[^a-zA-Z]", s):
38  return s
39  else:
40  return ""
def filter
Definition: linker.py:23
def linker.findMatchingFiles (   w,
  source_htmls 
)

Definition at line 15 of file linker.py.

References spr.find().

Referenced by getLink().

15 
16 def findMatchingFiles(w, source_htmls):
17  ret = ""
18  for srcFile in source_htmls:
19  if srcFile.split("/")[-1].__str__().find(w) != -1:
20  ret += " " + srcFile
21 
22  return ret
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
def findMatchingFiles
Definition: linker.py:15
def linker.getLink (   word)

Definition at line 41 of file linker.py.

References filter(), and findMatchingFiles().

Referenced by process().

41 
42 def getLink(word):
43 
44  if word.isdigit() or (len(word) < 5):
45  return ""
46 
47  out = filter(findMatchingFiles(word, py_source_htmls),word,"")
48  if not out or out == "":
49  out = filter(findMatchingFiles(word, h_source_htmls),word,"")
50  if not out or out == "":
51  return ""
52  return BASE+out.lstrip()
def getLink
Definition: linker.py:41
def filter
Definition: linker.py:23
def findMatchingFiles
Definition: linker.py:15
def linker.process (   filename)

Definition at line 53 of file linker.py.

References getLink(), Association.map, and replace().

53 
54 def process(filename):
55 
56  if (filename != None) and (len(filename) < 5):
57  return
58 
59  fh = open(filename,'r')
60  html = fh.read()
61  fh.close()
62 
63 
64  content = ""
65  # find only code block
66  soup = BeautifulSoup(html)
67  pres = soup.findAll("pre", {"class":"fragment"})
68 
69  for pre in pres:
70  if pre.contents != None:
71  content += pre.renderContents()
72  # END OF find only code block
73 
74  # remove links
75  content = replace(r'<a\b[^>]*>(.*?)</a>','',content)
76 
77  content = content.replace("&#39;", "'")
78  content = content.replace("&quot;", '"')
79 
80  matches = []
81  tmp = re.findall('[\w,\.]+_cf[i,g,f]',content)
82  for t in tmp:
83  matches.extend(t.split("."))
84 
85  matches.extend(re.findall('"\w+"',content))
86  matches.extend(re.findall("'\w+'",content))
87 
88  set = {} #
89  map(set.__setitem__, matches, []) # removing duplicate keywords
90  matches = set.keys() #
91 
92  for match in matches:
93 
94  match = match.replace("'", "")
95  match = match.replace('"', "")
96 
97  if (INDEX.has_key(match)):
98  href = INDEX[match]
99  else:
100  href = getLink(match)
101 
102  if (href != ""):
103  INDEX[match] = BASE+href[href.find("CMSSW_"):]
104 
105  link = "<a class=\"configfileLink\" href=\""+href+"\">"+match+"</a>"
106  regex = r"\b"+match+r"\b"
107  html = replace(regex, link, html)
108 
109  ########################
110  if printOutput:
111  print ">>>>>["+match+"]",
112  ########################
113 
114  ########################
115  if printOutput:
116  print href
117  ########################
118 
119  fh = open(filename,'w')
120  fh.write(html)
121  fh.close()
def getLink
Definition: linker.py:41
def process
Definition: linker.py:53
def replace
Definition: linker.py:10
dictionary map
Definition: Association.py:196
def linker.replace (   regex,
  replacement,
  content 
)

Definition at line 10 of file linker.py.

Referenced by betterConfigParser.BetterConfigParser.__updateDict(), metUncertaintyTools.RunMEtUncertainties._addCorrPFMEt(), python.iterators._findIterators(), trigTools.RemoveCleaningFromTriggerMatching._renameMatchers(), hltMuonPostProcessors_cff.add_reco_strings(), hltHiggsPostProcessors_cff.add_reco_strings(), pfTools.addPFCandidates(), packageDocSplitter.addTagToPackageDoc(), L1CondDBIOVWriter.analyze(), L1O2OTestAnalyzer.analyze(), jetTools.RunBTagging.apply(), MuonTrackResidualAnalyzer.beginJob(), MuonTrackAnalyzer.beginJob(), MultiTrackValidator.beginRun(), MuonTrackValidator.beginRun(), BTagDifferentialPlot.bookHisto(), EtaPtBin.buildDescriptionString(), cfgName2py.cfgName2py(), recoTauConfTools.cmssw_version(), electronDataDiscovery.common_search(), Vispa.Views.BoxDecayView.BoxDecayView.createBoxesRecursive(), cmsIgProf_Analysis.diff_igprof_analysis(), enablePileUpCorrection.enablePileUpCorrectionInPF2PAT(), confdb.HLTProcess.expandWildcards(), cmsPerfSuiteHarvest.exportIgProfReport(), cmsPerfSuiteHarvest.exportMemcheckReport(), cmsPerfSuiteHarvest.exportTimeSizeJob(), commentSkipper.cppCommentSkipper.filterFile(), commentSkipper.buildFileCommentSkipper.filterMultilineComment(), commentSkipper.buildFileCommentSkipper.filterOneLineComment(), harvestRelVal.find_dqmref(), MultipleCompare.FindParents(), hltTrgSeedMapper.findUniqueSeed(), edm::DaqProvenanceHelper.fixMetaData(), getRunInfo.Func_MakeShellWord(), generateWrappers.generateBuildFile(), relval_steps.genvalid(), harvestRelVal.get_cond_from_dsetpath(), harvestRelVal.get_name_from_dsetpath(), FileNamesHelper.getJobID_fromFileName(), betterConfigParser.BetterConfigParser.getResultingSection(), ShapeTools.ShapeBuilder.getShape(), alcaDQMUpload.getURL(), TreeCrawler.mymf.import_module(), L1TriggerKeyDummyProd.L1TriggerKeyDummyProd(), cmsIgProf_Analysis.library_igprof_analysis(), DBSApi_cff.loadXML(), uploader.main(), cmsRelvalreport.Profile.make_report(), SelectRuns.SelectRuns.makeList(), DOTExport.DotProducer.nodeURL(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.open(), cmsDriverOptions.OptionsFromItems(), TreeCrawler.packageNameFromFilename(), MatrixInjector.MatrixInjector.prepare(), ConfigBuilder.ConfigBuilder.prepare_LHE(), Association.prepareRefManFiles(), comments.prepareReplaceDict(), L1GtTriggerMenuTester.printWiki(), process(), cmsPerfSuiteHarvest.process_igprof_dir(), L1RCTOmdsFedVectorProducer.produce(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.pypackage(), RunInfoRead.readData(), Vispa.Plugins.ConfigEditor.ConfigDataAccessor.ConfigDataAccessor.recursePSetProperties(), tauTools.redoPFTauDiscriminators(), alcaDQMUpload.registerFileAtLogServer(), KinematicTree.replaceCurrentParticle(), KinematicTree.replaceCurrentVertex(), addOnTests.testit.run(), DQMStore.save(), Vispa.Gui.BoxContentDialog.BoxContentDialog.script(), BeamSpotWorkflow.selectFilesToProcess(), query.sendMessage(), cmsIgProf_Analysis.simple_igprof_analysis(), pfTools.switchToPFJets(), pfTools.switchToPFMET(), Config.TestModuleCommand.testSecSource(), coreTools.RunOnData.toolCode(), coreTools.RemoveMCMatching.toolCode(), HiCoreTools.RemoveCleaning.toolCode(), HiCoreTools.AddCleaning.toolCode(), coreTools.RemoveCleaning.toolCode(), tauTools.AddTauCollection.toolCode(), coreTools.AddCleaning.toolCode(), jetTools.AddJetCollection.toolCode(), trigTools.RemoveCleaningFromTriggerMatching.toolCode(), lumiReport.toScreenConfHlt(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController.updateViewMenu(), pfTools.useGsfElectrons(), pfTools.usePF2PAT(), pfTools.usePFIso(), and jetTools.SwitchJetCollection.vit().

10 
11 def replace(regex,replacement,content):
12  p = re.compile(regex,re.IGNORECASE);
13  c = p.sub(replacement,content)
14  return c
def replace
Definition: linker.py:10

Variable Documentation

string linker.BASE = "/cmsdoxygen/"

Definition at line 6 of file linker.py.

Referenced by edm::FileInPath.read(), and edm::FileInPath.readFromParameterSetBlob().

list linker.DIR = sys.argv[1]

Definition at line 124 of file linker.py.

Referenced by ExternalLHEProducer.closeDescriptors(), HCAL_HLX::ROOTFileReader.CreateFileNameList(), EcalLaserAnalyzerYousi.endJob(), evf::FileDescriptorHandler.FileDescriptorHandler(), get_filename(), and SiStripCommissioningOfflineClient.setInputFiles().

tuple linker.files = output.read()

Definition at line 146 of file linker.py.

Referenced by HcalCalibrator.endJob(), fillABSRPFiles(), SiStripDbParams.inputDcuInfoXmlFiles(), SiStripDbParams.inputFecXmlFiles(), SiStripDbParams.inputFedXmlFiles(), SiStripDbParams.inputModuleXmlFiles(), IO.IO(), pftools::IO.IO(), HcalPatternSource.loadPatterns(), main(), PlotCombiner(), and MillePedeAlignmentAlgorithm.terminate().

tuple linker.h_source_htmls = []

Definition at line 129 of file linker.py.

int linker.i = 0

Definition at line 147 of file linker.py.

dictionary linker.INDEX = {}

Definition at line 7 of file linker.py.

tuple linker.output = os.popen(query)

Definition at line 135 of file linker.py.

linker.printOutput = False;

Definition at line 8 of file linker.py.

tuple linker.py_source_htmls = []

Definition at line 130 of file linker.py.

string linker.query = "find "

Definition at line 134 of file linker.py.