-
Notifications
You must be signed in to change notification settings - Fork 0
/
GrepProvider.py
39 lines (30 loc) · 1.34 KB
/
GrepProvider.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from com.pnfsoftware.jeb.client.api import IScript, IGraphicalClientContext
from com.pnfsoftware.jeb.core import RuntimeProjectUtil
from com.pnfsoftware.jeb.core.actions import Actions, ActionContext, ActionXrefsData
from com.pnfsoftware.jeb.core.units.code import ICodeUnit
from com.pnfsoftware.jeb.core.units import IXmlUnit
from Utils import Helper
show_exported = False
class GrepProvider(IScript):
def run(self, ctx):
print("Running Script " + self.__class__.__name__)
engctx = ctx.getEnginesContext()
if not engctx:
print('Back-end engines not initialized')
return
projects = engctx.getProjects()
if not projects:
print('There is no opened project')
return
prj = projects[0]
helper = Helper(prj)
print("exported".center(15, ' ').center(60, '-'))
exported = helper.getComponentClasses(Helper.COMPONENT_PROVIDER, True)
for s in exported:
print(s.getAddress())
print("unexported".center(15, ' ').center(60, '-'))
unexported = helper.getComponentClasses(Helper.COMPONENT_PROVIDER, False)
for s in unexported:
print(s.getAddress())
print("total %d providers, %d exported" % (len(exported) + len(unexported),
len(exported)))