CMS 3D CMS Logo

Functions | Variables

Association Namespace Reference

Functions

def formatCVSLink
 Format CVS link.
def formatPackageDocumentationLink
def generateBranchHTML
 Generates HTML for Subsystem.
def generateLeavesHTML
 Generates HTML for subpackage.
def generateTree
 Fetches information about Subsystems/Packages/Subpackages from TagCollector.
def loadTemplates
 Read template file.
def parseJSON
def preparePackageDocumentationLinks
 Extract links to package documentation.
def prepareRefManFiles
 Prepate dictionary of doxygen generated html files.

Variables

string baseUrl = "/cmsdoxygen/"
 block = indexPageBlockNoTree
 Formating index page's pieces.
tuple branchHTML = generateBranchHTML(SRC_DIR, tree, subsystem)
 Generating treeviews.
list CMSSW_VERSION = sys.argv[1]
string contacts = ""
string cvsBaseUrl = "http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW"
 errorOnImport = False
tuple fileIN = open(SCRIPTS_LOCATION+"/indexPage/indexpage_warning.html", "r")
 Warning page.
string gitBaseUrl = "https://github.com/cms-sw/cmssw/tree"
string indexPageBlock
string indexPageBlockNoTree
string indexPageHTML = ""
int indexPageRowCounter = 0
tuple indexPageTemplateHTML = fileIN.read()
tuple managers = parseJSON('http://mantydze.web.cern.ch/mantydze/tcproxy.php?type=managers')
 Index Page Preparations.
dictionary map = {}
tuple output = open(PROJECT_LOCATION+"/doc/html/index.html", "w")
list packageDocLinks = []
list PROJECT_LOCATION = sys.argv[2]
string reason = "Failed during preparing treeview. "
dictionary refmanfiles = {}
string rowCssClass = "odd"
list SCRIPTS_LOCATION = sys.argv[3]
string SRC_DIR = "/src"
tuple treeHTML = treeTemplateHTML.replace("@TREE@", branchHTML)
tuple users = parseJSON('http://mantydze.web.cern.ch/mantydze/tcproxy.php?type=users')

Detailed Description

Created on Aug 29, 2011

@author: MantYdze

Function Documentation

def Association::formatCVSLink (   package,
  subpackage 
)

Format CVS link.

Definition at line 63 of file Association.py.

00064                                       :
00065     cvsLink = "[ <a target=\"_blank\" href=\""+cvsBaseUrl+"/"+package+"/"+subpackage+"\">cvs</a> ] "
00066     gitLink = "[ <a target=\"_blank\" href=\""+gitBaseUrl+"/"+CMSSW_VERSION+"/"+package+"/"+subpackage+"\">git</a> ] "
00067 
00068     return cvsLink+gitLink

def Association::formatPackageDocumentationLink (   package,
  subpackage 
)

Definition at line 69 of file Association.py.

00069                                                        :    
00070     for link in packageDocLinks:
00071         if (link.find(package+"_"+subpackage+".html") != -1):
00072             return "[ <a target=\"_blank\" href=\"../"+link+"\">packageDoc</a> ]"
00073     
00074     return ""
00075 
def Association::generateBranchHTML (   SRC_DIR,
  tree,
  branch 
)

Generates HTML for Subsystem.

Definition at line 118 of file Association.py.

00118                                              : 
00119     branchHTML = ""
00120     
00121     for package,subpackages in sorted(tree[branch].items()):
00122         branchHTML += "<li><span><strong>"+package+"</strong></span><ul>"
00123         
00124         for subpackage in subpackages:
00125             branchHTML += "<li>"+subpackage + " "+ formatCVSLink(package, subpackage) + " " + formatPackageDocumentationLink(package, subpackage)
00126             branchHTML += generateLeavesHTML(SRC_DIR, package, subpackage)
00127             branchHTML+="</li>"
00128             
00129         branchHTML +="</ul>"
00130     
00131     branchHTML += "</li>"    
00132     return branchHTML
00133 
def Association::generateLeavesHTML (   SRC_DIR,
  package,
  subpackage 
)

Generates HTML for subpackage.

Definition at line 96 of file Association.py.

00097                                                     :
00098     html = ""
00099     try:
00100         dirList=os.listdir(SRC_DIR + "/" + package+"/"+subpackage+"/interface/")
00101         for classfile in dirList:
00102             if classfile.endswith(".h"):
00103                 classfile = classfile.replace(".h", "")
00104                 for key in refmanfiles.keys():
00105                     if (key.find(classfile) != -1):
00106                         classfile = "<a target=\"_blank\" href=\""+refmanfiles[key]+"\">"+classfile+"</a>"
00107                         break
00108                 
00109                 html += "<li>"+classfile+"</li>"
00110     except:
00111         pass
00112     
00113     if html != "":
00114         html = "<ul>"+html+"</ul>"
00115     
00116     return html

def Association::generateTree (   release)

Fetches information about Subsystems/Packages/Subpackages from TagCollector.

Definition at line 77 of file Association.py.

00078                          :
00079     #data = json.loads(urllib2.urlopen('https://cmstags.cern.ch/tc/CategoriesPackagesJSON?release=' + release).read())
00080     data = parseJSON('http://mantydze.web.cern.ch/mantydze/tcproxy.php?type=packages&release=' + release)
00081     
00082     tree = {}
00083     subsystems = sorted(data.keys())
00084     
00085     for subsystem in subsystems:
00086         tree[subsystem] = {}
00087         for packagesub in data[subsystem]:        
00088             (package, subpackage) = packagesub.split("/")
00089             
00090             if not package in tree[subsystem]:
00091                 tree[subsystem][package] = []
00092             tree[subsystem][package].append(subpackage)
00093             
00094     return (tree, subsystems)

def Association::loadTemplates ( )

Read template file.

Definition at line 135 of file Association.py.

00136                    :
00137     templateFile = SCRIPTS_LOCATION+"/indexPage/tree_template.html" 
00138             
00139     fileIN = open(templateFile, "r")
00140     treeTemplateHTML = fileIN.read()
00141     fileIN.close()
00142     
00143     
00144     templateFile = SCRIPTS_LOCATION+"/indexPage/indexpage_template.html"  
00145     fileIN = open(templateFile, "r")
00146     indexPageTemplateHTML = fileIN.read()
00147     fileIN.close()
00148     
00149     
00150     return treeTemplateHTML, indexPageTemplateHTML

def Association::parseJSON (   url)

Definition at line 23 of file Association.py.

00024                   :
00025     ret = {}
00026     
00027     html = os.popen("curl \""+url+"\"")
00028     input = html.read()
00029     html.close()
00030     
00031     input = input.replace("{","").replace("}", "")
00032     collections = input.split("], ")
00033     
00034     for collection in collections:
00035         parts = collection.split(": [")
00036         title = parts[0].replace('"', '')
00037         list = parts[1].replace("]", "").replace('"', '').split(", ")
00038         ret[title] = list
00039     
00040     return ret
00041 

def Association::preparePackageDocumentationLinks (   DOC_DIR)

Extract links to package documentation.

Definition at line 53 of file Association.py.

00054                                              :
00055     source = open(DOC_DIR+"/pages.html", "r")
00056     lines = source.read().split("\n")
00057     source.close()
00058     
00059     for line in lines:
00060         if (line.find("li><a class=\"el\" href=\"") != -1):
00061             packageDocLinks.append(line.split("\"")[3])

def Association::prepareRefManFiles (   DOC_DIR)

Prepate dictionary of doxygen generated html files.

Definition at line 43 of file Association.py.

00043                                :    
00044     output = os.popen("find "+DOC_DIR+" -wholename '*/class*.html' -not \( -name '*-members.html' \) -print")
00045     lines = output.read().split("\n")
00046     output.close()
00047     
00048     for line in lines:
00049         (head, tail) = os.path.split(line)
00050         refmanfiles[tail.replace("class","").replace(".html","")] = baseUrl+line[line.find(CMSSW_VERSION):]
00051 

Variable Documentation

string Association::baseUrl = "/cmsdoxygen/"

Definition at line 18 of file Association.py.

tuple Association::branchHTML = generateBranchHTML(SRC_DIR, tree, subsystem)

Generating treeviews.

Definition at line 230 of file Association.py.

list Association::CMSSW_VERSION = sys.argv[1]

Definition at line 155 of file Association.py.

string Association::contacts = ""

Definition at line 241 of file Association.py.

string Association::cvsBaseUrl = "http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/CMSSW"

Definition at line 16 of file Association.py.

Definition at line 7 of file Association.py.

tuple Association::fileIN = open(SCRIPTS_LOCATION+"/indexPage/indexpage_warning.html", "r")

Warning page.

Definition at line 177 of file Association.py.

string Association::gitBaseUrl = "https://github.com/cms-sw/cmssw/tree"

Definition at line 17 of file Association.py.

Initial value:
00001 """
00002 <tr class=\"@ROW_CLASS@\">
00003     <td width=\"50%\"><a href=\"#@SUBSYSTEM@\" onclick=\"javascript:getIframe('@SUBSYSTEM@')\">@SUBSYSTEM@</a></td>
00004     <td width=\"50%\" class=\"contact\">@CONTACTS@</td>
00005 </tr>
00006 <tr><td colspan=\"2\"><span id=\"@SUBSYSTEM@\"></span></td></tr>
00007 """

Definition at line 191 of file Association.py.

Initial value:
00001 """
00002 <tr class=\"@ROW_CLASS@\">
00003     <td width=\"50%\">@SUBSYSTEM@</td>
00004     <td width=\"50%\" class=\"contact\">@CONTACTS@</td>
00005 </tr>
00006 <tr><td colspan=\"2\"><span id=\"@SUBSYSTEM@\"></span></td></tr>
00007 """

Definition at line 199 of file Association.py.

Definition at line 189 of file Association.py.

Definition at line 190 of file Association.py.

tuple Association::indexPageTemplateHTML = fileIN.read()

Definition at line 178 of file Association.py.

tuple Association::managers = parseJSON('http://mantydze.web.cern.ch/mantydze/tcproxy.php?type=managers')

Index Page Preparations.

Definition at line 172 of file Association.py.

dictionary Association::map = {}

Definition at line 208 of file Association.py.

Referenced by SiStripDetCabling::addActiveDetectorsRawIds(), SiStripDetCabling::addAllDetectorsRawIds(), SiStripFEDErrorsDQM::addErrors(), SiStripDetCabling::addFromSpecificConnection(), HcalLutManager::addLutMap(), SiStripMonitorCluster::analyze(), SiStripMonitorHLT::analyze(), EcalCosmicsHists::analyze(), SiStripMonitorDigi::analyze(), EcalBarrelSimHitsValidation::analyze(), SimplePi0DiscAnalyzer::analyze(), EcalEndcapSimHitsValidation::analyze(), DTCompactMapWriter::appendROS(), VertexAssociatorByTracks::associateRecoToSim(), VertexAssociatorByTracks::associateSimToReco(), QTestHandle::attachTests(), MonitorTrackResiduals::beginRun(), RPCGeometryBuilderFromCondDB::build(), ConvertedPhotonProducer::buildCollections(), SiStripDetVOffBuilder::BuildDetVOffObj(), RPCGeometryBuilderFromDDD::buildGeometry(), DTCompactMapWriter::buildSteering(), TagProbeFitTreeAnalyzer::calculateEfficiency(), PFClusterAlgo::cleanRBXAndHPD(), ora::TransactionCache::cleanUpNamedRefCache(), ora::TransactionCache::clear(), DTCompactMapWriter::cloneROS(), MuonMillepedeAlgorithm::collect(), GlobalRecHitsAnalyzer::compute(), GlobalRecHitsProducer::compute(), PhysicsTools::MVATrainer::connectProcessors(), ora::Database::containers(), OnDemandMeasurementTracker::define(), ora::Database::drop(), RPCLinkSynchroStat::dumpDelays(), ora::DatabaseUtilitySession::existsContainer(), fwlite::RecordWriter::fill(), MuonAlignment::fillGapsInSurvey(), DTCompactMapWriter::fillReadOutMap(), HLTCSCOverlapFilter::filter(), RPCRecHitFilter::filter(), HLTCSCRing2or3Filter::filter(), CSCDigiValidator::filter(), SiPixelInformationExtractor::findNoisyPixels(), ora::Database::flush(), EMap::get_map(), HcalEmap::get_map(), HcalLutManager::get_xml_files_from_db(), getCentralityFromFile(), SimpleMTFHitCollector::getMeasurements(), pos::PixelPortcardMap::getName(), popcon::EcalTPGWeightGroupHandler::getNewObjects(), RPCDBPerformanceHandler::getNewObjects(), PVFitter::getNPVsperBX(), trigger::HLTPrescaleTable::HLTPrescaleTable(), HcalChannelIterator::init(), CSCDigitizer::layersMissing(), RPCFakeCalibration::makeCls(), XMLDocument::makeMaps(), RPCFakeCalibration::makeNoise(), CosmicMuonLinksProducer::mapTracks(), pos::PixelPortcardMap::modules(), edm::operator||(), QualityTester::performTests(), cond::PayLoadInspector< DataT >::plot(), SiStripInformationExtractor::plotHistosFromLayout(), pos::PixelPortcardMap::PortCardAndAOHs(), pos::PixelPortcardMap::portcards(), edm::service::RandomNumberGeneratorService::print(), L1GtBoard::print(), SiStripActionExecutor::printShiftHistoParameters(), CkfDebugger::printSimHits(), SiPixelGainCalibrationAnalysis::printSummary(), magneticfield::AutoMagneticFieldESProducer::produce(), sistrip::FEDEmulatorModule::produce(), DTDigiToRawModule::produce(), SecondaryVertexProducer::produce(), SiStripInformationExtractor::readLayoutNames(), SiStripDaqInfo::readSubdetFedFractions(), CSCOverlapsAlignmentAlgorithm::run(), ConversionTrackPairFinder::run(), PVFitter::runBXFitter(), Selections::Selections(), EcalSelectiveReadout::setElecMap(), HcalBaseSignalGenerator::setParameterMap(), EcalSelectiveReadoutSuppressor::setTriggerMap(), EcalSelectiveReadout::setTriggerMap(), edm::detail::CachedProducts::setup(), AlignmentMonitorBase::startingNewLoop(), evf::FUEventProcessor::subWeb(), EMap_test::test_read_map(), HcalEmap_test::test_read_map(), ZdcTestAnalysis::update(), FWLiteESRecordWriterAnalyzer::update(), and HcalLutManager::writeLutXmlFiles().

tuple Association::output = open(PROJECT_LOCATION+"/doc/html/index.html", "w")

Definition at line 183 of file Association.py.

Definition at line 20 of file Association.py.

list Association::PROJECT_LOCATION = sys.argv[2]

Definition at line 156 of file Association.py.

string Association::reason = "Failed during preparing treeview. "

Definition at line 180 of file Association.py.

Referenced by stor::FileHandler::moveFileToClosed().

dictionary Association::refmanfiles = {}

Definition at line 19 of file Association.py.

string Association::rowCssClass = "odd"

Definition at line 249 of file Association.py.

list Association::SCRIPTS_LOCATION = sys.argv[3]

Definition at line 157 of file Association.py.

string Association::SRC_DIR = "/src"

Definition at line 159 of file Association.py.

tuple Association::treeHTML = treeTemplateHTML.replace("@TREE@", branchHTML)

Definition at line 232 of file Association.py.

tuple Association::users = parseJSON('http://mantydze.web.cern.ch/mantydze/tcproxy.php?type=users')

Definition at line 173 of file Association.py.