|
|
|
@ -19,7 +19,7 @@
|
|
|
|
|
# Miroslav Lichvar <mlichvar@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import gmenu, sys
|
|
|
|
|
import gmenu, re, sys
|
|
|
|
|
from xml.sax.saxutils import escape
|
|
|
|
|
|
|
|
|
|
def walk_menu(entry):
|
|
|
|
@ -29,10 +29,14 @@ def walk_menu(entry):
|
|
|
|
|
map(walk_menu, entry.get_contents())
|
|
|
|
|
print '</menu>'
|
|
|
|
|
elif entry.get_type() == gmenu.TYPE_ENTRY and not entry.is_excluded:
|
|
|
|
|
print """
|
|
|
|
|
<item label="%s">
|
|
|
|
|
<action name="Execute"><command>%s</command></action>
|
|
|
|
|
</item> """ % (escape(entry.get_name()), escape(entry.get_exec()))
|
|
|
|
|
print ' <item label="%s">' % escape(entry.get_name())
|
|
|
|
|
command = re.sub(' [^ ]*%[fFuUdDnNickvm]', '', entry.get_exec())
|
|
|
|
|
if entry.launch_in_terminal:
|
|
|
|
|
command = 'xterm -title "%s" -e %s' % \
|
|
|
|
|
(entry.get_name(), command)
|
|
|
|
|
print ' <action name="Execute">' + \
|
|
|
|
|
'<command>%s</command></action>' % escape(command)
|
|
|
|
|
print ' </item>'
|
|
|
|
|
|
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
|
menu = sys.argv[1] + '.menu'
|
|
|
|
|