From 3d58f3f0ffc9041ad6f87364e0b209c0b0a8cdb3 Mon Sep 17 00:00:00 2001 From: Dpk3062 Date: Mon, 06 Jul 2009 03:48:30 +0000 Subject: * Now using Curses for text display * 'Main Menu' working * 'Change Player' menu working * Putting constants and strings in utils.strs.py * Added class 'Profile' * Renamed class 'LevelInfo' to 'Level' Note: paths still hard coded for main developer's machine --- (limited to 'src/setup/level.py') diff --git a/src/setup/level.py b/src/setup/level.py index 907d8bd..193e8f7 100644 --- a/src/setup/level.py +++ b/src/setup/level.py @@ -1,10 +1,12 @@ ''' ''' -from lxml import etree -from utils import utils +from lxml import etree # using lxml for XML processing +from utils import strs # string constants +from utils import utils # some XML utilities -class LevelInfo(object): + +class Level(object): ''' ''' @@ -15,16 +17,17 @@ class LevelInfo(object): #open up the mlvl file and read in its basic properties root = utils.getXMLRoot(path) - self.name = root.xpath('//level-info/@name')[0] - self.description = root.xpath('//level-info/@description')[0] + self.name = root.xpath(strs.XP_LevelName)[0] + self.description = root.xpath(strs.XP_LevelName)[0] + self.path = path pass def getName(self): - '''Gets the name of this level''' + '''Returns the name of this level''' return self.name def getDescription(self): - '''Gets the description of this level''' + '''Returns the description of this level''' return self.description -- cgit v0.9.1