CMS 3D CMS Logo

Functions | Variables
fetchall_from_DQM_v2 Namespace Reference

Functions

def auth_wget (url, chunk_size=1048576)
 

Variables

 action
 
 all_files
 
 args
 
 base_url
 
 default
 
 dest
 
 False
 
 file_list_re
 
 file_res
 Fetch the files, using multi-processing. More...
 
 filedir_html
 
 filedir_url
 
 help
 
 mthreads
 
 options
 Parse sys.argv. More...
 
 parser
 Define options. More...
 
 pool
 
 regexp
 
 release
 
 releasedir
 
 relvaldir
 Check for option errors. More...
 
 selected_files
 
 usage
 

Detailed Description

Script fetches files matching specified RegExps from DQM GUI.

Author:  Albertas Gimbutas,  Vilnius University (LT)
e-mail:  albertasgim@gmail.com

Function Documentation

def fetchall_from_DQM_v2.auth_wget (   url,
  chunk_size = 1048576 
)
Returns the content of specified URL, which requires authentication.
If the content is bigger than 1MB, then save it to file.

Definition at line 38 of file fetchall_from_DQM_v2.py.

References estimatePileup.basename, and createfilelist.int.

38 def auth_wget(url, chunk_size=1048576):
39  """Returns the content of specified URL, which requires authentication.
40  If the content is bigger than 1MB, then save it to file.
41  """
42  opener = build_opener(X509CertOpen())
43  url_file = opener.open(Request(url))
44  size = int(url_file.headers["Content-Length"])
45 
46  if size < 1048576: # if File size < 1MB
47  filename = basename(url) #still download
48  readed = url_file.read() ## and then check if its not an empty dir (parent directory)
49  if filename != '':
50  outfile = open(filename, 'wb') #then write File to local system
51  outfile.write(readed)
52  return readed
53 
54  filename = basename(url)
55  file_id = selected_files.index(filename)
56 
57  if isfile("./%s" % filename):
58  print '%d. Exsits on disk. Skipping.' % (file_id +1)
59  return
60 
61  print '%d. Downloading...' % (file_id +1)
62  file = open(filename, 'wb')
63  # progress = 0
64  chunk = url_file.read(chunk_size)
65  while chunk:
66  file.write(chunk)
67  # progress += chunk_size
68  chunk = url_file.read(chunk_size)
69  print '%d. Done.' % (file_id +1)
70  file.close()
71 
72 
def auth_wget(url, chunk_size=1048576)

Variable Documentation

fetchall_from_DQM_v2.action

Definition at line 75 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.all_files

Definition at line 123 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.args

Definition at line 90 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.base_url

Definition at line 115 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.default

Definition at line 81 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.dest

Definition at line 75 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.False

Definition at line 87 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.file_list_re

Definition at line 122 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.file_res

Fetch the files, using multi-processing.

Definition at line 130 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.filedir_html

Definition at line 117 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.filedir_url

Definition at line 116 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.help

Definition at line 76 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.mthreads

Definition at line 125 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.options

Parse sys.argv.

Definition at line 90 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.parser

Define options.

Definition at line 74 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.pool

Definition at line 139 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.regexp
fetchall_from_DQM_v2.release

Definition at line 91 of file fetchall_from_DQM_v2.py.

Referenced by XMLConfigReader.buildGP(), ConfigurationDBHandler.cvt2String(), edm::DataMixingModule.DataMixingModule(), cms::xerces.dispose(), SaxToDom.error(), SaxToDom2.error(), L1GtTriggerMenuXmlParser.findXMLChild(), XMLDOMBlock.getNewDocument(), XMLConfigReader.getPatternsVersion(), L1GtTriggerMenuXmlParser.getXMLAttribute(), L1GtTriggerMenuXmlParser.getXMLTextValue(), MonitorXMLParser.handleElement(), cond::XMLAuthenticationService::XMLAuthenticationService.initialize(), L1GtTriggerMenuXmlParser.initXML(), MonitorXMLParser.load(), MonitorXMLParser.MonitorXMLParser(), MuonAlignmentInputXML.newAlignableMuon(), XMLDOMBlock.parse(), L1GtTriggerMenuXmlParser.parseConditions(), MuonAlignmentInputXML.parseDouble(), SummaryPlotXmlParser.parseXML(), cond::XMLAuthenticationService::XMLAuthenticationService.processFile(), HcalItemArrayColl< Item, N >.push_back(), CalibrationXML.readAttribute(), XMLConfigReader.readConfig(), l1t::XmlConfigParser.readContext(), l1t::XmlConfigParser.readHwDescription(), XMLConfigReader.readPatterns(), XMLProcessor.serializeDOM(), HcalItemArrayCollById< Item, N >.setDefault(), SaxToDom.startElement(), SaxToDom2.startElement(), edm::eventsetup::DataKey.swap(), cscdqm::XMLFileErrorHandler.warning(), L1GtTriggerMenuXmlParser.workXML(), CalibrationXML.writeAttribute(), xMLCh2String(), XMLDOMBlock.XMLDOMBlock(), ConfigurationDBHandler.~ConfigurationDBHandler(), cond::persistency::IGTTable.~IGTTable(), LutXml.~LutXml(), MonitorXMLParser.~MonitorXMLParser(), MuonAlignmentInputXML.~MuonAlignmentInputXML(), edm::SingleConsumerQ::OperateBuffer< T >.~OperateBuffer(), cond::persistency::GLOBAL_TAG::Table.~Table(), TagNames.~TagNames(), XMLSimpleStr.~XMLSimpleStr(), lhef::XMLSimpleStr.~XMLSimpleStr(), XMLUniStr.~XMLUniStr(), lhef::XMLUniStr.~XMLUniStr(), and XStr.~XStr().

fetchall_from_DQM_v2.releasedir

Definition at line 113 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.relvaldir

Check for option errors.

Use options

Definition at line 106 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.selected_files

Definition at line 131 of file fetchall_from_DQM_v2.py.

fetchall_from_DQM_v2.usage

Definition at line 74 of file fetchall_from_DQM_v2.py.