blob: 1f05f10dd029459620c851146ce9426b148e891a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
'''
'''
if __name__ == '__main__':
pass
import os
# using lxml for XML processing
from lxml import etree
from level import LevelInfo
from utils import utils
# constants
ConfigFile = '/home/doug/workspace/Muthris/docs/examples/config.xml'
LevelExt = '.mlvl'
# load the configuration file
config = utils.getXMLRoot(ConfigFile)
#for each level folder, scan for and process any Muthris level files (.mlvl)
levels = []
folders = config.xpath('//level-folders/folder/@location')
for folder in folders:
#search for files in the level folder
list = os.listdir(folder)
print(list)
for path in list:
#make sure path is not just the filename, as isfile() would fail if it was
path = folder + '/' + path
#only want level files
if not os.path.isfile(path):
continue
if not path.endswith(LevelExt):
continue
#create a level object for this level file
level = LevelInfo( path )
levels.append( level )
print( config )
print( folders )
# find all the level folders
# load all the level folders
# start the menus
print( 'done' )
def processLevelFile( file ):
''' '''
pass
|