comparison python/html2flux.py @ 884:e5861cbbc4bb

python3
author Jeff Hammel <k0scist@gmail.com>
date Wed, 05 Aug 2020 09:45:27 -0700
parents 3b7f67021877
children
comparison
equal deleted inserted replaced
883:3b7f67021877 884:e5861cbbc4bb
123 123
124 # print menu items 124 # print menu items
125 for name, item in menu: 125 for name, item in menu:
126 if isinstance(item, string): 126 if isinstance(item, string):
127 # command 127 # command
128 print >> output, '[exec] (%s) {%s}' % (name, item) 128 output.write('[exec] (%s) {%s}\n' % (name, item))
129 else: 129 else:
130 # submenu 130 # submenu
131 printflux(name, item, output, top=False) 131 printflux(name, item, output, top=False)
132 132
133 # print end of this submenu 133 # print end of this submenu
134 if not top: 134 if not top:
135 print >> output, '[end]' 135 output.write('[end]\n')
136
136 137
137 def printmenu(dl, output): 138 def printmenu(dl, output):
138 name, menu = readmenu(dl, output) 139 name, menu = readmenu(dl, output)
139 if isinstance(output, string): 140 if isinstance(output, string):
140 with open(output, 'w') as f: 141 with open(output, 'w') as f: