1 import os
.path
, MenuMaker
, Prophet
6 from MenuMaker
import indent
, writeFullMenu
11 menuFile
= "~/.mygtkmenu.txt"
17 for d
, s
in (("\'", "\""),) :
25 def emit(self
, level
) :
26 return ['%sSEPARATOR' % indent(level
)]
32 def emit(self
, level
) :
35 if self
.app
.terminal
:
36 cmd
= MenuMaker
.terminal
.runCmd(cmd
)
38 '%sitem = %s' % (x
, _map(self
.app
.name
)),
39 '%scmd = %s' % (x
, cmd
),
47 def emit(self
, level
) :
48 menu
= ['%sSubmenu = %s' % (indent(level
), _map(self
.name
)),
49 '%sicon = NULL' % indent(level
+ 1),
53 menu
+= x
.emit(level
+ 1)
60 def __init__(self
, subs
) :
62 subs
= subs
+ [MenuMaker
.Sep(), SysMenu()]
63 super(Root
, self
).__init
__(subs
)
64 def emit(self
, level
) :
82 class SysMenu(MenuMaker
.Menu
) :
90 super(SysMenu
, self
).__init
__(subs
)
91 self
.align
= MenuMaker
.Entry
.StickBottom
94 class X(MenuMaker
.Entry
) :
95 def __init__(self
, x
) :
96 super(X
, self
).__init
__()
97 self
.align
= MenuMaker
.Entry
.StickBottom
99 def emit(self
, level
) :
100 return [indent(level
) + self
.x
]