本文整理汇总了Python中LogStream.logEvent方法的典型用法代码示例。如果您正苦于以下问题:Python LogStream.logEvent方法的具体用法?Python LogStream.logEvent怎么用?Python LogStream.logEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LogStream
的用法示例。
在下文中一共展示了LogStream.logEvent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def __init__(self, conf="testIFPImage", userName="", baseTime=None,
timeRange=None, usrTimeRange=None):
from com.raytheon.uf.viz.core.localization import LocalizationManager
self.site = LocalizationManager.getInstance().getCurrentSite()
self._topo = 0
# import the config file
self.config = __import__(conf)
loadConfig.loadPreferences(self.config)
self.baseTime = baseTime
# Create GFEPainter first and get DataManager from painter
self.viz = self.createPainter()
self.dm = self.viz.getDataManager();
LogStream.logEvent("Configuration File: ", conf)
self.pgons = None
self.imgParm = None
self.ipn = self.getConfig('Png_image', '')
# user named time range specified?
if usrTimeRange is not None:
s_tr = self.dm.getSelectTimeRangeManager().getRange(usrTimeRange)
if s_tr is None:
LogStream.logProblem(usrTimeRange, \
" is not a valid time range name.")
sys.exit(1)
else:
tr = TimeRange.TimeRange(s_tr.toTimeRange())
self.pngTimeRange = tr
else:
self.pngTimeRange = timeRange
示例2: startThreads
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def startThreads(self):
LogStream.logEvent("Starting Threads")
self.t1 = threading.Thread(target=self.broadcast)
self.t1.setDaemon(True)
self.t1.start()
self.t2 = threading.Thread(target=self.discover)
self.t2.setDaemon(True)
self.t2.start()
示例3: main
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def main():
LogStream.logEvent("setupTextEA Starting")
try:
obj = setupTextEA()
obj.process()
except Exception, e:
LogStream.logProblem(LogStream.exc())
sys.exit(1)
示例4: _remapPil
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def _remapPil(self, phen, sig, pil):
# remaps the product pil for certain phen/sig/pils. The VTECDecoder
# needs to relate hazards through all states from the same pil. Some
# short-fused hazards issue in one pil and followup/cancel in
# another pil.
key = (phen, sig, pil)
rPil = self._mappedPils.get(key, pil)
if rPil != pil:
LogStream.logEvent("Remapped Pil", key, "->", rPil)
return rPil
示例5: executeFromJava
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def executeFromJava(databaseID):
LogStream.logEvent("PurgeAllGrids starting")
try:
process(databaseID)
LogStream.logEvent("PurgeAllGrids finished")
sys.exit(0)
except SystemExit:
pass
except:
LogStream.logProblem("Caught exception\n", LogStream.exc())
示例6: decode
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def decode(self):
#get pil and date-time group
self._productPil, self._issueTime, linePos,\
self._completeProductPil = self._getPilAndDTG()
# If this is a WCL - don't go any further. Run WCL procedure and exit.
if self._productPil[0:3] == "WCL":
endpoint = "WCLWatch"
# build a Java object for the warning
from com.raytheon.edex.plugin.gfe.wcl import WclInfo
import JUtil
lines = JUtil.pyValToJavaObj(self._lines)
warning = WclInfo(long(self._issueTime * 1000),
self._completeProductPil, lines, self._notifyGFE)
from com.raytheon.uf.edex.core import EDEXUtil
EDEXUtil.getMessageProducer().sendAsync(endpoint, warning)
LogStream.logEvent("%s forwarded to WCLWatch" % self._productPil)
return []
# Determine if this is a segmented product
segmented = self._determineSegmented(linePos)
# Get overview text
if segmented == 1:
self._overviewText, linePos = self._getOverviewText(linePos)
else:
self._overviewText = ''
LogStream.logDebug("OverviewText: ", self._overviewText)
#find all UGCs, VTEC strings, and segment text
ugcVTECList = self._getUGCAndVTECStrings(linePos)
self._polygon = self._getPolygon(linePos)
self._storm = self._getStorm(linePos)
#convert UGC strings into UGC list
ugcVTECSegText = []
segCount = 1
for ugcString, vtecStrings, segText, cities in ugcVTECList:
purgeTime = None
self._checkForDTG(ugcString)
if self._hasDTG:
purgeTime = self._dtgFromDDHHMM(ugcString[-7:-1])
else:
purgeTime = self._getPurgeTimeFromVTEC(vtecStrings)
vtecList = self._expandVTEC(ugcString, vtecStrings, segCount,
segText, cities, purgeTime)
segCount = segCount + 1
for r in vtecList:
ugcVTECSegText.append(r)
if len(ugcVTECSegText) == 0:
LogStream.logVerbose("No VTEC Found in product")
return
return ugcVTECSegText
示例7: main
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def main():
path = siteConfig.GFESUITE_LOGDIR+"/"
if(os.path.exists(path)):
purgeAge = IFPServerConfigManager.getServerConfig(siteConfig.GFESUITE_SITEID).logFilePurgeAfter()
duration = 86400 * purgeAge
cutoffTime = time.strftime("%Y%m%d", time.gmtime(time.time() - duration))
LogStream.logEvent("Purging GFE log files older than", purgeAge, "days")
dirList = os.listdir(path)
for fname in dirList:
if fname < cutoffTime:
shutil.rmtree(path + fname)
示例8: main
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def main():
LogStream.ttyLogOn();
LogStream.logEvent("getEditAreas Starting")
LogStream.logEvent(AFPS.DBSubsystem_getBuildDate(),
AFPS.DBSubsystem_getBuiltBy(),
AFPS.DBSubsystem_getBuiltOn(),
AFPS.DBSubsystem_getBuildVersion())
try:
obj = simpleFetch()
obj.SetIntersection()
except Exception, e:
LogStream.logBug(LogStream.exc())
sys.exit(1)
示例9: process
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def process(dbname):
LogStream.logEvent("Purging all grids from: ", dbname)
# get list of parms
db = IFPDB(dbname)
parms = db.getKeys()
# cycle through each parm, get inventory, and store None grid to
# remove the grids
for p in range(0, parms.size()):
we = db.getItem(str(parms.get(p)))
inv = we.getKeys()
for i in range(0, inv.size()):
we.removeItem(inv.get(i))
示例10: __init__
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def __init__(self, procName, host, port, userName,
configFile, startTime, endTime, timeRange, editArea,
mutableModel, varDict):
# import the config file
prefs = loadConfig.loadPreferences(configFile)
LogStream.logEvent("Configuration File: ", configFile)
if mutableModel is None:
mutableModel = prefs.getString('mutableModel')
else:
prefs.setValue('mutableModel', mutableModel)
self.__dataMgr = DataManager.getInstance(None)
# Create Time Range
if startTime is not None and endTime is not None:
start = self.getAbsTime(startTime)
end = self.getAbsTime(endTime)
self.__timeRange = TimeRange.TimeRange(start, end)
elif timeRange is not None:
self.__timeRange = TimeRange.TimeRange(self.__dataMgr.getSelectTimeRangeManager().getRange(timeRange).toTimeRange());
else:
self.__timeRange = TimeRange.default()
if editArea is not None:
refID = ReferenceID(editArea)
self.__editArea = \
self.__dataMgr.getRefManager().loadRefSet(refID)
else:
self.__editArea = self.__dataMgr.getRefManager().emptyRefSet()
LogStream.logVerbose("varDict=",varDict)
runner = ProcedureRunner(procName)
errors = runner.getImportErrors()
if len(errors) > 0:
print "Error importing the following procedures:\n"
for s in errors:
print s
sys.exit(1)
runner.instantiate(procName, CLASS_NAME, **{'dbss':self.__dataMgr})
runner.run(self.__dataMgr, procName, CLASS_NAME, METHOD_NAME, varDict, self.__editArea, self.__timeRange)
示例11: main
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def main():
LogStream.logEvent("ifpIMAGE Starting")
DEFAULT_OUTPUT_DIR = '../products/IMAGE'
#import siteConfig
config = 'gfeConfig'
userNameOption = 'SITE'
#outDir = siteConfig.GFESUITE_PRDDIR + "/IMAGE"
outDir = DEFAULT_OUTPUT_DIR
tr = TimeRange.allTimes()
startTime = tr.startTime()
baseTime = None
endTime = tr.endTime()
usrTimeName = None
#port = int(siteConfig.GFESUITE_PORT)
try:
optlist, oargs = getopt.getopt(sys.argv[1:], "c:u:h:p:o:b:s:e:t:")
for opt in optlist:
if opt[0] == '-c':
config = opt[1]
elif opt[0] == '-u':
userNameOption = opt[1]
elif opt[0] == '-o':
outDir = opt[1]
elif opt[0] == '-s':
startTime = decodeTimeString(opt[1])
elif opt[0] == '-e':
endTime = decodeTimeString(opt[1])
elif opt[0] == '-t':
usrTimeName = opt[1]
elif opt[0] == '-b':
baseTime = decodeTimeString(opt[1])
except getopt.GetoptError, e:
LogStream.logProblem(e)
usage()
raise SyntaxError, "Bad command line argument specified"
示例12: mergeHazardGrids
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def mergeHazardGrids(self):
# get the hazards selected by the forecaster
hazParms = self.getHazardParmNames()
self._hazUtils._removeAllHazardsGrids()
for hazParm in hazParms:
trList = self._hazUtils._getWEInventory(hazParm)
for tr in trList:
byteGrid, hazKey = self.getGrids(MODEL, hazParm, LEVEL, tr,
mode="First")
if isinstance(hazKey, str):
hazKey = eval(hazKey)
uniqueKeys = self._hazUtils._getUniqueKeys(byteGrid, hazKey)
for uKey in uniqueKeys:
if uKey == "<None>":
continue
subKeys = self._hazUtils._getSubKeys(uKey)
for subKey in subKeys:
# make the mask - find all areas that contain the subKey
mask = numpy.zeros(byteGrid.shape)
for haz in hazKey:
if string.find(haz, subKey) >= 0:
hazIndex = self.getIndex(haz, hazKey)
mask = numpy.logical_or(numpy.equal(byteGrid, hazIndex), mask)
# make the grid
self._hazUtils._addHazard(ELEMENT, tr, subKey, mask)
LogStream.logEvent("merge: " + \
str(self._hazUtils._printTime(tr.startTime().unixTime())) + " " + \
str(self._hazUtils._printTime(tr.endTime().unixTime())) + " " + \
subKey + "\n")
self.removeTempHazards()
return
示例13: run
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def run(self):
LogStream.logEvent("Running with ShutDown Value:", self.__shutdown)
tcps = SocketServer.TCPServer(('', 0), self.Handler)
tcps.table = self.table
tcps.tlock = self.tlock
self.addr = tcps.server_address
self.startThreads()
poll_interval = 2.0
while not self.__shutdown:
r, w, e = select.select([tcps], [], [], poll_interval)
if r:
tcps.handle_request()
if IRTManager.getInstance().isRegistered(self.wanid) == False:
LogStream.logEvent("Shutting Down GFE Socket Server for site [", self.wanid, "]...")
self.__shutdown = True
LogStream.logEvent("Stopping Broadcast thread for site [", self.wanid, "]...")
self.t1.join()
LogStream.logEvent("Stopping Discovery thread for site [", self.wanid, "]...")
self.t2.join()
LogStream.logEvent("GFE Socket Server for site [", self.wanid, "] shut down")
示例14: checkForMerge
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def checkForMerge(self):
# get the hazards selected by the forecaster
hazParms = self.getHazardParmNames()
# check for empty list of hazards
if hazParms == []:
self.statusBarMsg("No temporary grids to merge.", "S")
return
# FIXME: Lock race condition
# check for conflicting locks
if self._hazUtils._conflictingLocks(hazParms):
self.statusBarMsg("There are conflicting locks. " +
"Please resolve these before merging any hazards", "S")
return
conflicts = self.checkForHazardConflicts(hazParms)
if conflicts is None:
# if no conflicts, merge the grids
# We made the hazards parm immutable when we separated hazard grids.
# It has to be made mutable to do the merge.
parm = self.getParm(MODEL, ELEMENT, LEVEL)
parm.setMutable(True)
self.mergeHazardGrids()
else:
haz1 = string.replace(conflicts[1][0], ".", "")
haz2 = string.replace(conflicts[1][1], ".", "")
timeRange = str(conflicts[0])
msg = "Hazard conflict detected!\n\n"
msg += "Time: " + timeRange + " \n\n"
msg += "with Hazard grids haz" + haz1 + " and haz" + haz2 + ".\n"
LogStream.logEvent("Merge conflict: "+ msg)
self.displayDialog(msg)
return
示例15: createDomainDict
# 需要导入模块: import LogStream [as 别名]
# 或者: from LogStream import logEvent [as 别名]
def createDomainDict(xml):
irt = IrtAccess.IrtAccess("")
#decodes the packet of information from the ISC_REQUEST_QUERY call
#to the ifpServer. This info will be used for creating the dialog.
# Returns the domainDict, which is keyed by domain, and contains
# a list of servers (each server in a dictionary with keys of
# mhsid, host, port, protocol, site.
try:
serverTree = ElementTree.ElementTree(ElementTree.XML(xml))
serversE = serverTree.getroot()
except:
LogStream.logProblem('Malformed XML in createDomainDict')
return None
if serversE.tag != "servers":
LogStream.logEvent('servers tag not found in createDomainDict')
return None #invalid xml
#decode XML and create dictionary and parms list
domains = {}
welist = []
serverDictS2T = {} #key=serverinfo, value=text on GUI
serverDictT2S = {} #key=text on GUI, value=serverinfo
for domainE in serversE:
if domainE.tag == "domain":
site = None
for name, value in domainE.items():
if name == "site":
site = value
break
if site is None:
LogStream.logProblem('Malformed domain site XML')
continue
for addressE in domainE.getchildren():
info = irt.decodeXMLAddress(addressE)
if not domains.has_key(site):
domains[site] = []
list = domains[site]
list.append(info)
guiText = serverBoxText(info)
serverDictT2S[guiText] = info
serverDictS2T[str(info)] = guiText
list.sort(sortServers)
domains[site] = list
elif domainE.tag == "welist":
for parmE in domainE.getchildren():
welist.append(parmE.text)
welist.sort()
retVal = {}
retVal['serverDictS2T'] = serverDictS2T
retVal['serverDictT2S'] = serverDictT2S
retVal['domains'] = domains
tempfile.tempdir = "/tmp/"
fname = tempfile.mktemp(".bin")
FILE = open(fname, "w")
pickle.dump(retVal, FILE)
FILE.close()
FILE = open(fname, "r")
lines = FILE.readlines()
FILE.close()
os.remove(fname)
pickledFile = ""
for line in lines:
pickledFile += line
return pickledFile