comparison pyink/domview.py @ 1407:f19121bd6a6c

Check if the name is defined for old SVG file.
author wycc
date Wed, 06 Apr 2011 07:48:29 +0800
parents ac61d86987af
children 485cca025a77
comparison
equal deleted inserted replaced
1406:88c8c874f4b8 1407:f19121bd6a6c
33 def __init__(self, scenes_node): 33 def __init__(self, scenes_node):
34 self.scenes_node = scenes_node 34 self.scenes_node = scenes_node
35 pass 35 pass
36 36
37 def name(self): 37 def name(self):
38 name = self.scenes_node.getAttribute('name') 38 try:
39 name = self.scenes_node.getAttribute('name')
40 except:
41 name='default'
39 return name 42 return name
40 43
41 def rename(self, new_name): 44 def rename(self, new_name):
42 scenes_node = self.scenes_node 45 scenes_node = self.scenes_node
43 scenes_node.setAttribute('name', new_name) 46 scenes_node.setAttribute('name', new_name)