/usr/share/pyshared/jpypex/swing/pyutils.py is in python-jpype 0.5.4.2-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | import sys
from jpype import *
__JMenuBar = javax.swing.JMenuBar
__JMenu = javax.swing.JMenu
def buildMenuBar(menuDef) :
mb = __JMenuBar()
for i in menuDef :
jm = buildMenu(i[0], i[1])
mb.add( JObject(jm, __JMenu) )
return mb
def buildMenu(name, menuDef) :
jm = __JMenu(name)
for i in menuDef :
if i is None :
jm.addSeparator()
elif isinstance(i, list) or isinstance(i, tuple) :
jm2 = buildMenu(i[0], i[1])
jm.add(jm2)
else:
jm.add(i.proxy)
return jm
|