Changeset 71
- Timestamp:
- Mon Jul 18 13:46:16 2005
- Files:
-
- trunk/transolution/xliffeditor/tm/tm_client.py (modified) (diff)
- trunk/transolution/xliffeditor/tm/utils.py (modified) (diff)
- trunk/transolution/tm/server/estreen.py (modified) (diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
trunk/transolution/xliffeditor/tm/tm_client.py
r2 r71 32 32 class TmException(Exception):pass 33 33 class TmNoMatchFoundException(TmException):pass 34 class TmAddTuServerException(TmException):pass 34 35 35 36 class TMClient(object): … … 47 48 def addTU(self,source_node,target_node): 48 49 'add source and target nodes, index them as plain text without tag info' 49 source = shallowNodeCopy(source_node) 50 target = shallowNodeCopy(target_node) 51 self.server.addTU(toxml(source),toxml(target)) 50 try: 51 source = shallowNodeCopy(source_node) 52 target = shallowNodeCopy(target_node) 53 self.server.addTU(toxml(source),toxml(target)) 54 except xmlrpclib.Fault, fault: 55 raise TmAddTuServerException(fault.faultString) 52 56 53 57 def lookup(self,lookup): … … 57 61 quality,tm_source,tm_target = self.server.lookup(lookup_xml) 58 62 except xmlrpclib.Fault, fault: 59 ## print fault.faultCode60 ## print fault.faultString61 63 raise TmNoMatchFoundException(fault.faultString) 62 64 -
trunk/transolution/xliffeditor/tm/utils.py
r2 r71 52 52 if child.tagName == node.tagName: 53 53 try: 54 if getNodeAttr( node,'id') == id:54 if getNodeAttr(child,'id') == id: 54 54 return child 55 55 except KeyError,e: -
trunk/transolution/tm/server/estreen.py
r40 r71 40 40 target = parseString(target.encode('utf-8')).firstChild 41 41 index_text = getPlainText(source.childNodes) 42 if index_text: 42 if index_text.strip(): 42 42 print "addTU:",index_text.encode('utf-8') 43 43 #create key
