|
Lines 1-4
Link Here
|
| 1 |
#!/usr/bin/python |
1 |
# obxml.py |
| 2 |
# |
2 |
# |
| 3 |
# Openbox Menu Editor 1.0 beta |
3 |
# Openbox Menu Editor 1.0 beta |
| 4 |
# |
4 |
# |
|
Lines 117-123
Link Here
|
| 117 |
accion = it.attributes["name"].nodeValue |
117 |
accion = it.attributes["name"].nodeValue |
| 118 |
if accion.lower() == "execute": |
118 |
if accion.lower() == "execute": |
| 119 |
for itm in it.childNodes: |
119 |
for itm in it.childNodes: |
| 120 |
if itm.nodeType == 1 and itm.nodeName.lower() == "execute": |
120 |
if itm.nodeType == 1 and itm.nodeName.lower() == "command": |
| 121 |
for item in itm.childNodes: |
121 |
for item in itm.childNodes: |
| 122 |
if item.nodeType == 3: |
122 |
if item.nodeType == 3: |
| 123 |
param = item.nodeValue.strip() |
123 |
param = item.nodeValue.strip() |
|
Lines 207-213
Link Here
|
| 207 |
nodo.attributes["label"] = label |
207 |
nodo.attributes["label"] = label |
| 208 |
accion = self.dom.createElement("action") |
208 |
accion = self.dom.createElement("action") |
| 209 |
accion.attributes["name"] = "Execute" |
209 |
accion.attributes["name"] = "Execute" |
| 210 |
exe = self.dom.createElement("execute") |
210 |
exe = self.dom.createElement("command") |
| 211 |
txt = self.dom.createTextNode("") |
211 |
txt = self.dom.createTextNode("") |
| 212 |
txt.nodeValue = execute |
212 |
txt.nodeValue = execute |
| 213 |
exe.appendChild(txt) |
213 |
exe.appendChild(txt) |
|
Lines 256-269
Link Here
|
| 256 |
it.attributes["name"].nodeValue = action |
256 |
it.attributes["name"].nodeValue = action |
| 257 |
if action == "Execute": |
257 |
if action == "Execute": |
| 258 |
if not it.childNodes: |
258 |
if not it.childNodes: |
| 259 |
elm = xml.dom.minidom.Element("execute") |
259 |
elm = xml.dom.minidom.Element("command") |
| 260 |
txt = xml.dom.minidom.Text() |
260 |
txt = xml.dom.minidom.Text() |
| 261 |
txt.nodeValue = exe |
261 |
txt.nodeValue = exe |
| 262 |
elm.appendChild(txt) |
262 |
elm.appendChild(txt) |
| 263 |
it.appendChild(elm) |
263 |
it.appendChild(elm) |
| 264 |
else: |
264 |
else: |
| 265 |
for i in it.childNodes: |
265 |
for i in it.childNodes: |
| 266 |
if i.nodeType == 1 and i.nodeName == "execute": |
266 |
if i.nodeType == 1 and i.nodeName == "command": |
| 267 |
for item in i.childNodes: |
267 |
for item in i.childNodes: |
| 268 |
if item.nodeType == 3: |
268 |
if item.nodeType == 3: |
| 269 |
item.nodeValue = exe |
269 |
item.nodeValue = exe |