"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "translate/storage/xliff.py" between
translate-toolkit-2.2.4.tar.gz and translate-toolkit-2.2.5.tar.gz

About: Translate Toolkit is a set of software and documentation designed to make localization of software more productive and less frustrating.

xliff.py  (translate-toolkit-2.2.4):xliff.py  (translate-toolkit-2.2.5)
skipping to change at line 796 skipping to change at line 796
bodynode = filenode.iterchildren(self.namespaced("body")) bodynode = filenode.iterchildren(self.namespaced("body"))
try: try:
return next(bodynode) return next(bodynode)
except StopIteration: except StopIteration:
pass pass
if not createifmissing: if not createifmissing:
return None return None
bodynode = etree.SubElement(filenode, self.namespaced("body")) bodynode = etree.SubElement(filenode, self.namespaced("body"))
return bodynode return bodynode
def addunit(self, unit, new=True):
parts = unit.getid().split("\x04")
if len(parts) > 1:
filename, unitid = parts[0], "\x04".join(parts[1:])
self.switchfile(filename, createifmissing=True)
unit.setid(unitid)
super(xlifffile, self).addunit(unit, new=new)
def addsourceunit(self, source, filename="NoName", createifmissing=False): def addsourceunit(self, source, filename="NoName", createifmissing=False):
"""adds the given trans-unit to the last used body node if the filename """adds the given trans-unit to the last used body node if the filename
has changed it uses the slow method instead (will create the nodes has changed it uses the slow method instead (will create the nodes
required if asked). Returns success required if asked). Returns success
""" """
if self._filename != filename: if self._filename != filename:
if not self.switchfile(filename, createifmissing): if not self.switchfile(filename, createifmissing):
return None return None
unit = super(xlifffile, self).addsourceunit(source) unit = super(xlifffile, self).addsourceunit(source)
self._messagenum += 1 self._messagenum += 1
 End of changes. 1 change blocks. 
0 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)