Developers

Automating an OmniEngine using Python

A place for developers to exchange information about extending OmniPeek, and ask technical questions about plugins on MyPeek, scripting, and programming.
Spacepacket
Posts: 78
Joined: Thu May 22, 2008 9:36 am

Automating an OmniEngine using Python

Postby Spacepacket » Tue May 11, 2010 6:03 pm

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

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 12 guests