# HG changeset patch # User prock@33b003aa-7bff-0310-803a-e67f0ece8222 # Date 1273701812 0 # Node ID 559a263477304e9eb5245cb847e439781503f94b # Parent 987307d12235876a2b62c2ea30d3c198e0ea7431 Forgot to add fife_settings.py in my last commit. Adding it now. diff -r 987307d12235 -r 559a26347730 engine/python/fife/extensions/fife_settings.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/engine/python/fife/extensions/fife_settings.py Wed May 12 22:03:32 2010 +0000 @@ -0,0 +1,230 @@ +# -*- coding: utf-8 -*- + +# #################################################################### +# Copyright (C) 2005-2010 by the FIFE team +# http://www.fifengine.net +# This file is part of FIFE. +# +# FIFE is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the +# Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# #################################################################### + +""" +Settings +================================== + +This module provides a nice framework for loading and saving game settings. +It is by no means complete but it does provide a good starting point. + +@note: Please note that you MUST provide a default settings-dist.xml file +in the root directory of your project for this module to function correctly. +""" + +import shutil +import os +from StringIO import StringIO + +from fife.extensions import pychan +from fife.extensions.fife_utils import getUserDataDirectory +try: + import xml.etree.cElementTree as ET +except: + import xml.etree.ElementTree as ET + + +SETTINGS_GUI_XML="""\ + +