simplified code a bit

This commit is contained in:
fpdb-mme 2009-11-05 00:39:42 +01:00
parent 7a602846ff
commit 14200c5a50

View File

@ -561,15 +561,13 @@ class Config:
if int( location_node.getAttribute("seat") ) == int( seat ): if int( location_node.getAttribute("seat") ) == int( seat ):
return location_node return location_node
def save(self, file = None): def save(self, file=None):
if file != None: if file is None:
with open(file, 'w') as f: file = self.file
self.doc.writexml(f)
else:
shutil.move(self.file, self.file+".backup") shutil.move(self.file, self.file+".backup")
with open(self.file, 'w') as f: with open(file, 'w') as f:
self.doc.writexml(f) self.doc.writexml(f)
def edit_layout(self, site_name, max, width = None, height = None, def edit_layout(self, site_name, max, width = None, height = None,
fav_seat = None, locations = None): fav_seat = None, locations = None):
site_node = self.get_site_node(site_name) site_node = self.get_site_node(site_name)