mirror of
https://github.com/shlomif/PySolFC.git
synced 2025-04-15 02:54:09 -04:00
extract method.
This commit is contained in:
parent
494a52a04b
commit
bbf038300b
1 changed files with 6 additions and 5 deletions
|
@ -28,15 +28,16 @@ class KpatXmlEmitter:
|
||||||
self._tags = []
|
self._tags = []
|
||||||
self._indent = 0
|
self._indent = 0
|
||||||
|
|
||||||
def writeEmptyTag(self, name, attrs):
|
def _genericTag(self, suf, name, attrs):
|
||||||
self._ind_out(
|
self._ind_out(
|
||||||
"<" + name + "".join([" "+x[0]+"=\""+x[1]+"\"" for x in attrs])
|
"<" + name + "".join([" "+x[0]+"=\""+x[1]+"\"" for x in attrs])
|
||||||
+ "/>\n")
|
+ suf + ">\n")
|
||||||
|
|
||||||
|
def writeEmptyTag(self, name, attrs):
|
||||||
|
self._genericTag("/", name, attrs)
|
||||||
|
|
||||||
def writeStartTag(self, name, attrs):
|
def writeStartTag(self, name, attrs):
|
||||||
self._ind_out(
|
self._genericTag("", name, attrs)
|
||||||
"<" + name + "".join([" "+x[0]+"=\""+x[1]+"\"" for x in attrs])
|
|
||||||
+ ">\n")
|
|
||||||
self._tags.append({'name': name})
|
self._tags.append({'name': name})
|
||||||
self._indent += 1
|
self._indent += 1
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue