Page 1 of 1

Automating an OmniEngine using Python

Posted: Tue May 11, 2010 6:03 pm
by Spacepacket
Below is a Python script that will create a capture from a capture template. The capture template also specifies a filter that is dynamically loaded as well.

import win32com.client
oe = win32com.client.Dispatch("EPRCmdAPI.WPRemoteCmdMgr")
oe.Connect("127.0.0.1", 6367, 30000 )
xf = win32com.client.Dispatch("Microsoft.XMLDOM")
xt = win32com.client.Dispatch("EPRCmdAPI.xmlTranslate")
xf.async = 0
xf.Load("filters.flt")
tf = xt.Load( xf, xf.lastChild, "PeekFilters.FilterCollection" )
oe.SetFilters( tf, 1 )
ct = win32com.client.Dispatch("Microsoft.XMLDOM")
ct.Load("capturetemplate.xml")
cg = oe.CreateNewCaptureFromTemplate( ct )
oe.StartCapture( cg )

The script depends on the filter and capture template files that are included in the following vb script:

https://mypeek.wildpackets.com/view_sub ... .php?id=96