CMS 3D CMS Logo

Classes | Functions | Variables
visDQMUpload Namespace Reference

Classes

class  HTTPSCertAuth
 
class  HTTPSCertAuthenticate
 

Functions

def encode (args, files)
 
def filetype (filename)
 
def marshall (args, files, request)
 
def upload (url, args, files)
 

Variables

 buf
 
 classification_ok
 
 classification_result
 
 data
 
 file
 
 hasher
 
 headers
 
 HTTPS
 
 ssl_cert_file
 
 ssl_key_file
 
 status
 
 uid
 
 x509_path
 

Function Documentation

◆ encode()

def visDQMUpload.encode (   args,
  files 
)
  Encode form (name, value) and (name, filename, type) elements into
  multi-part/form-data. We don't actually need to know what we are
  uploading here, so just claim it's all text/plain.

Definition at line 48 of file visDQMUpload.py.

48 def encode(args, files):
49  """
50  Encode form (name, value) and (name, filename, type) elements into
51  multi-part/form-data. We don't actually need to know what we are
52  uploading here, so just claim it's all text/plain.
53  """
54  boundary = b'----------=_DQM_FILE_BOUNDARY_=-----------'
55  (body, crlf) = (b'', b'\r\n')
56  for (key, value) in args.items():
57  payload = str(value).encode('utf-8')
58  body += b'--' + boundary + crlf
59  body += (b'Content-Disposition: form-data; name="%s"' % key.encode('utf-8')) + crlf
60  body += crlf + payload + crlf
61  for (key, filename) in files.items():
62  body += b'--' + boundary + crlf
63  body += (b'Content-Disposition: form-data; name="%s"; filename="%s"'
64  % (key.encode('utf-8'), os.path.basename(filename).encode('utf-8'))) + crlf
65  body += (b'Content-Type: %s' % filetype(filename).encode('utf-8')) + crlf
66  body += (b'Content-Length: %d' % os.stat(filename)[ST_SIZE]) + crlf
67  with open(filename, 'rb') as file:
68  body += crlf + file.read() + crlf
69  body += b'--' + boundary + b'--' + crlf + crlf
70  return (b'multipart/form-data; boundary=' + boundary, body)
71 

References filetype(), and str.

Referenced by marshall().

◆ filetype()

def visDQMUpload.filetype (   filename)

Definition at line 45 of file visDQMUpload.py.

45 def filetype(filename):
46  return mimetypes.guess_type(filename)[0] or 'application/octet-stream'
47 

Referenced by encode().

◆ marshall()

def visDQMUpload.marshall (   args,
  files,
  request 
)
  Marshalls the arguments to the CGI script as multi-part/form-data,
  not the default application/x-www-form-url-encoded.  This improves
  the transfer of the large inputs and eases command line invocation
  of the CGI script.

Definition at line 72 of file visDQMUpload.py.

72 def marshall(args, files, request):
73  """
74  Marshalls the arguments to the CGI script as multi-part/form-data,
75  not the default application/x-www-form-url-encoded. This improves
76  the transfer of the large inputs and eases command line invocation
77  of the CGI script.
78  """
79  (type, body) = encode(args, files)
80  request.add_header('Content-Type', type)
81  request.add_header('Content-Length', str(len(body)))
82  request.data = body
83 

References encode(), and str.

Referenced by upload().

◆ upload()

def visDQMUpload.upload (   url,
  args,
  files 
)

Definition at line 84 of file visDQMUpload.py.

84 def upload(url, args, files):
85  ident = "visDQMUpload DQMGUI/%s python/%s" % \
86  (os.getenv('DQMGUI_VERSION', '?'), "%d.%d.%d" % sys.version_info[:3])
87  datareq = urllib2.Request(url + '/data/put')
88  datareq.add_header('Accept-encoding', 'gzip')
89  datareq.add_header('User-agent', ident)
90  marshall(args, files, datareq)
91  if 'https://' in url:
92  result = urllib2.build_opener(HTTPSCertAuthenticate()).open(datareq)
93  else:
94  result = urllib2.build_opener(urllib2.ProxyHandler({})).open(datareq)
95 
96  data = result.read()
97  if result.headers.get ('Content-encoding', '') == 'gzip':
98  data = gzip.GzipFile (fileobj=StringIO(data)).read ()
99  return (result.headers, data)
100 

References marshall().

Variable Documentation

◆ buf

visDQMUpload.buf

Definition at line 154 of file visDQMUpload.py.

Referenced by XMLProcessor._toXMLCh(), LutXml.addData(), LutXml.addParameter(), DDScope.addScope(), npstat::ArrayND< Num1, Len1, Dim1 >.addToProjection(), ParticleListDrawer.analyze(), EcalTPGParamBuilder.analyze(), ext::basic_imemstream< Item_t, Traits_t, Allocator_t >.basic_imemstream(), PickEvents.beginJob(), EcalSelectiveReadoutValidation.bookHistograms(), evf::EvFDaqDirector.bumpFile(), DCacheStorageMaker.check(), clangcms::EDMPluginDumper.checkASTDecl(), evf::DirManager.checkDirEmpty(), FedRawDataInputSource.checkNext(), npstat.clearBuffer(), XrdAdaptor::ClientRequest.ClientRequest(), LaserSorter.closeOutStream(), hitfit::Constrained_Top.Constrained_Top(), hitfit::Constrained_Z.Constrained_Z(), convertFile(), FFTJetCorrector< Jet, Adjustable >.correct(), crc32c(), crc32c_sw(), evf::EvFDaqDirector.createBoLSFile(), evf::EvFDaqDirector.createLumiSectionFiles(), CSCALCTHeader.CSCALCTHeader(), CSCALCTTrailer.CSCALCTTrailer(), CSCAnodeData.CSCAnodeData(), CSCAnodeData2006.CSCAnodeData2006(), CSCAnodeData2007.CSCAnodeData2007(), CSCCFEBData.CSCCFEBData(), CSCChamberDataItr.CSCChamberDataItr(), CSCCLCTData.CSCCLCTData(), CSCDCCEventData.CSCDCCEventData(), CSCDDUDataItr.CSCDDUDataItr(), CSCDDUEventData.CSCDDUEventData(), CSCDMBHeader.CSCDMBHeader(), CSCDMBHeader2005.CSCDMBHeader2005(), CSCDMBHeader2013.CSCDMBHeader2013(), CSCDMBTrailer.CSCDMBTrailer(), CSCDMBTrailer2005.CSCDMBTrailer2005(), CSCDMBTrailer2013.CSCDMBTrailer2013(), CSCEventData.CSCEventData(), CSCRPCData.CSCRPCData(), CSCTMBBlockedCFEB.CSCTMBBlockedCFEB(), CSCTMBData.CSCTMBData(), CSCTMBHeader.CSCTMBHeader(), CSCTMBHeader2006.CSCTMBHeader2006(), CSCTMBHeader2007.CSCTMBHeader2007(), CSCTMBHeader2007_rev0x50c3.CSCTMBHeader2007_rev0x50c3(), CSCTMBHeader2013.CSCTMBHeader2013(), CSCTMBMiniScope.CSCTMBMiniScope(), CSCTMBScope.CSCTMBScope(), CSCTMBTrailer.CSCTMBTrailer(), dataPointer(), DDRotation.DDRotation(), evf::EvFBuildingThrottle.dowork(), dumpEvent(), dumpFiles(), GeometryInfoDump.dumpInfo(), dumpInit(), CastorDbASCIIIO.dumpObject(), EcalLaserAPDPNRatiosXMLTranslator.dumpXML(), EcalLinearCorrectionsXMLTranslator.dumpXML(), EcalTPGParamBuilder.EcalTPGParamBuilder(), ElectronPFIsolationWithConeVeto.ElectronPFIsolationWithConeVeto(), CTPPSProtonReconstructionEfficiencyEstimatorMC.endJob(), CTPPSProtonReconstructionEfficiencyEstimatorData.endJob(), evf::EvFDaqDirector.EvFDaqDirector(), extractNextObject(), FileInStream_Read(), dqm::DQMFileSaverBase.filename(), FileSeqInStream_Read(), SiPixelRawDataErrorModule.fill(), SiPixelRawDataErrorModule.fillFED(), SiPixelDataQuality.fillGlobalQualityPlot(), SiStripHistoPlotter.fillNamedImageBuffer(), evf::DirManager.findHighestRun(), evf::DirManager.findHighestRunDir(), findLine(), evf::DirManager.findRunDir(), hitfit::Top_Fit.fit(), CTPPSTotemDataFormatter.formatRawData(), EcalSelectiveReadoutValidation.frame2Energy(), FRDEventMsgView.FRDEventMsgView(), get_info(), HcalQIEManager.getHfQieTable(), WatcherStreamFileReader.getInputFile(), InterpolatedPulse< 1500U >.getIntegral(), evf::EvFDaqDirector.getLumisectionToStart(), HcalLutManager.getLutSetFromFile(), evf::EvFDaqDirector.getNextFromFileBroker(), evf::EvFDaqDirector.getNFilesFromEoLS(), InterpolatedPulse< 1500U >.getPeakValue(), HcalQIEManager.getQIETableFromFile(), HcalQIEManager.getTableFromDb(), SimpleSAXParser.getToken(), evf::EvFDaqDirector.grabNextJsonFile(), L1TGlobalPrescalesVetosViewer.hash(), L1TMuonBarrelParamsViewer.hash(), L1TMuonGlobalParamsViewer.hash(), L1TMuonOverlapParamsViewer.hash(), L1TCaloParamsViewer.hash(), HeaderView.HeaderView(), npstat::HistoND< Numeric, Axis >.HistoND(), DTTPGLutFile.ignoreLines(), L1TriggerLutFile.ignoreLines(), RPCCompDetId.initGas(), evf::EvFDaqDirector.initRun(), InterpolatedPulse< 1500U >.InterpolatedPulse(), ConstantStepOdeSolver.interpolateIntegrated(), CTPPSRPAlignmentCorrectionsMethods.iovValueToString(), CSCEventData.isALCT(), CSCEventData.isTMB(), L1Analysis::L1AnalysisEvent.L1AnalysisEvent(), dqmservices::DQMProtobufReader.load(), L1MuGMTLUT.Load(), MonitorXMLParser.load(), MatacqProducer.loadOrbitOffset(), RemoteFile.local(), LookInStream_LookRead(), LookInStream_Read(), LookInStream_Read2(), LookToRead_Look_Exact(), LookToRead_Look_Lookahead(), LookToRead_Read(), lutFmt(), LzmaDec_DecodeReal(), LzmaDec_TryDummy(), makeGifHists(), L1MuGMTLUT.MakeSubClass(), FFTEtaLogPtConeRadiusMapper< MyJet, Adjustable >.map(), FFTSpecificScaleCalculator< MyJet, Adjustable >.map(), L2ResScaleCalculator.mapFFTJet(), L2RecoScaleCalculator.mapFFTJet(), FFTGenericScaleCalculator.mapFFTJet(), L2AbsScaleCalculator.mapFFTJet(), FedRawDataInputSource.maybeOpenNewLumiSection(), MatacqProducer.mread(), MatacqProducer.msize(), MuonPFIsolationWithConeVeto.MuonPFIsolationWithConeVeto(), now(), DQMNet.onLocalNotify(), DQMNet.onPeerData(), npstat::LinInterpolatedTableND< Numeric, Axis >.operator()(), InterpolatedPulse< 1500U >.operator*=(), InterpolatedPulse< 1500U >.operator=(), InterpolatedPulse< 1500U >.operator==(), ReadRepacker.pack(), ReadRepacker.packInternal(), DQMNet.packQualityData(), dqm::impl::MonitorElement.packScalarData(), edm::service::CPU.parseCPUInfo(), PrescaleWeightProvider.parseL1Seeds(), PhotonPFIsolationWithConeVeto.PhotonPFIsolationWithConeVeto(), MODCCSHFDat.populateClob(), IODConfig.populateClob(), edm::service::SimpleMemoryCheck.postEndJob(), bitset_utilities.printWords(), TotemTriggerRawToDigi.ProcessLoneGFrame(), pps::RawDataUnpacker.processOptoRxFrame(), pps::RawDataUnpacker.processOptoRxFrameParallel(), pps::RawDataUnpacker.processOptoRxFrameSampic(), pps::RawDataUnpacker.processOptoRxFrameSerial(), npstat::ArrayND< Num1, Len1, Dim1 >.processSubrange(), pps::RawDataUnpacker.processVFATDataParallel(), CSCDCCUnpacker.produce(), TotemTriggerRawToDigi.produce(), npstat::ArrayND< Num1, Len1, Dim1 >.project(), dqm::impl::MonitorElement.qualityTagString(), SectorProcessorLUT.read_file(), TStorageFactoryFile.ReadBuffer(), TStorageFactoryFile.ReadBuffers(), TStorageFactoryFile.ReadBuffersSync(), edm::StreamerInputFile.readBytes(), lhef::CBInputStream.readBytes(), lhef::STLInputStream.readBytes(), lhef::StorageInputStream.readBytes(), PhysicsTools::MVAComputer.readCalibration(), MODCCSHFDat.readClob(), IODConfig.readClob(), LmfSource.readEventWithinFile(), L1MuGMTHWFileReader.readNextEvent(), readParticlesFromHepMC(), readRemote(), EcalLaserCondTools::FileReader.readTime(), HcalSimpleRecAlgoImpl.removePileup(), edm::service::IgProfService.replace(), IgProfModule.replace(), edm::service::IgProfService.replaceU64(), IgProfModule.replaceU64(), npstat::ArrayND< Num1, Len1, Dim1 >.rotate(), LegacyIOHelper.save(), dqm::DQMFileSaverPB.savePB(), AbsFFTJetScaleCalculator< MyJet, Adjustable >.scale(), SecToLook_Read(), SecToRead_Read(), EcalSelectiveReadoutValidation.selectFedsForLog(), SeqInStream_Read(), SeqInStream_Read2(), SeqInStream_ReadByte(), edm::StreamerOutputModuleCommon.serializeRegistry(), MonitorElementData::Path.set(), MillePedeTrees.SetBowsParameters(), PedeReader.setCalibrationParameter(), gen::Pythia6Service.setCSAParams(), CSCALCTHeader2006.setFromBuffer(), CSCDDUHeader.setFromBuffer(), CSCALCTTrailer2006.setFromBuffer(), CSCDCCHeader.setFromBuffer(), CSCALCT.setFromBuffer(), CSCDDUTrailer.setFromBuffer(), CSCDCCTrailer.setFromBuffer(), CSCALCTTrailer2007.setFromBuffer(), CSCALCTHeader2007.setFromBuffer(), CSCALCTs2006.setFromBuffer(), CSCVirtexID.setFromBuffer(), CSCConfigurationRegister.setFromBuffer(), CSCCollisionMask.setFromBuffer(), CSCHotChannelMask.setFromBuffer(), PlotMillePede.SetNbins(), PedeReader.setParameter(), DDExpandedView.setScope(), InterpolatedPulse< 1500U >.setShape(), MillePedeTrees.SetSurfDefDeltaBows(), MillePedeTrees.SetUseSignedR(), SiPixelEDAClient.SiPixelEDAClient(), edm::service::InitRootHandlers.stacktraceFromThread(), edm::service::InitRootHandlers.stacktraceHelperThread(), L1MuGMTLUT::PortDecoder.str(), LaserSorter.streamFileName(), npstat::ArrayND< Num1, Len1, Dim1 >.subtractFromProjection(), dqm::impl::MonitorElement.tagLabelString(), EcalLaserCondTools.timeToString(), cms::MD5Result.toString(), LmfSource.toString(), LaserSorter.toString(), TrackingAnalyser.TrackingAnalyser(), ConstantStepOdeSolver.truncateCoordinate(), typePointer(), CSCSPEvent.unpack(), CSCSPCounters.unpack(), CSCTFEvent.unpack(), ReadRepacker.unpack(), CSCSP_MBblock.unpack(), CSCSPTrailer.unpack(), CSCSPRecord.unpack(), CSCSP_MEblock.unpack(), CSCSPHeader.unpack(), CSCSP_SPblock.unpack(), CSCDCCEventData.unpack_data(), CSCDDUEventData.unpack_data(), CSCEventData.unpack_data(), CSCTMBBlockedCFEB.UnpackBlockedCFEB(), CSCTMBMiniScope.UnpackMiniScope(), CSCTMBScope.UnpackScope(), CSCTMBData.UnpackTMB(), evf::EvFDaqDirector.updateFuLock(), bitset_utilities.ushortToBitset(), VersionedSelector< edm::Ptr< reco::Photon > >.VersionedSelector(), CSCDCCUnpacker.visual_raw(), WatcherStreamFileReader.WatcherStreamFileReader(), CSCWireGeometry.wireValues(), CTPPSProtonReconstructionPlotter::SingleRPPlots.write(), CTPPSProtonReconstructionEfficiencyEstimatorData::ArmData.write(), CTPPSTrackDistributionPlotter::ArmPlots.write(), MuonAssociatorByHitsHelper.write_matched_simtracks(), TStorageFactoryFile.WriteBuffer(), EcalDccWeightBuilder.writeWeightToRootFile(), xMLCh2String(), LStoreFile::MutexWrapper.~MutexWrapper(), and TagNames.~TagNames().

◆ classification_ok

visDQMUpload.classification_ok

Definition at line 142 of file visDQMUpload.py.

◆ classification_result

visDQMUpload.classification_result

Definition at line 142 of file visDQMUpload.py.

◆ data

visDQMUpload.data

Definition at line 157 of file visDQMUpload.py.

◆ file

visDQMUpload.file

Definition at line 131 of file visDQMUpload.py.

◆ hasher

visDQMUpload.hasher

◆ headers

visDQMUpload.headers

Definition at line 157 of file visDQMUpload.py.

◆ HTTPS

visDQMUpload.HTTPS

Definition at line 30 of file visDQMUpload.py.

◆ ssl_cert_file

visDQMUpload.ssl_cert_file

Definition at line 35 of file visDQMUpload.py.

◆ ssl_key_file

visDQMUpload.ssl_key_file

Definition at line 34 of file visDQMUpload.py.

◆ status

visDQMUpload.status

Definition at line 116 of file visDQMUpload.py.

◆ uid

visDQMUpload.uid

Definition at line 116 of file visDQMUpload.py.

◆ x509_path

visDQMUpload.x509_path

Definition at line 101 of file visDQMUpload.py.

str
#define str(s)
Definition: TestProcessor.cc:48
visDQMUpload.encode
def encode(args, files)
Definition: visDQMUpload.py:48
visDQMUpload.marshall
def marshall(args, files, request)
Definition: visDQMUpload.py:72
visDQMUpload.upload
def upload(url, args, files)
Definition: visDQMUpload.py:84
visDQMUpload.filetype
def filetype(filename)
Definition: visDQMUpload.py:45