1 import configobj
, os
, gui
, pygame
, sys
3 cf
= configobj
.ConfigObj(os
.path
.join(sys
.path
[0], 'couchpytato.cfg'))
4 th
= configobj
.ConfigObj(os
.path
.join(sys
.path
[0], 'themes', cf
['theme'], 'theme.cfg'))
6 modcf
= cf
['modules'][modname
]
10 return os
.path
.join(sys
.path
[0], 'themes', cf
['theme'], file)
13 for i
in range(len(th
['fonts'].values())):
14 font
= th
['fonts'].values()[i
]
17 fonts
[th
['fonts'].keys()[i
]] = pygame
.font
.Font(ttf
, size
)
22 for obj
in th
[module
].values():
23 name
= th
[module
].keys()[i
]
24 xpos
= int(obj
['xpos'])
25 ypos
= int(obj
['ypos'])
26 layer
= int(obj
['layer'])
28 contentkey
= obj
['contentkey']
33 fxspeed
= int(obj
['fx'][1])
37 if obj
['class'] == 'IMAGE':
38 image
= thpath(obj
['image'])
40 size
= int(obj
['size'])
44 alpha
= int(obj
['alpha'])
48 hflip
= bool(obj
['hflip'])
52 vflip
= bool(obj
['vflip'])
56 degree
= int(obj
['degree'])
59 GUI
.append(gui
.Image(name
, xpos
, ypos
, layer
, image
, size
, alpha
, hflip
, vflip
, degree
))
61 if obj
['class'] == 'LABEL':
62 font
= fonts
[obj
['font']]
63 color
= int(obj
['color'][0]), int(obj
['color'][1]), int(obj
['color'][2])
69 width
= int(obj
['width'])
76 GUI
.append(gui
.Label(name
, xpos
, ypos
, layer
, font
, color
, text
, width
, extra
))
78 if obj
['class'] == 'LIST':
79 barlayer
= int(obj
['barlayer'])
80 barimage
= thpath(obj
['barimage'])
81 xoff
= int(obj
['xoff'])
82 yoff
= int(obj
['yoff'])
83 listbar
= gui
.ListBar('bar', xpos
, ypos
, barlayer
, barimage
, xoff
, yoff
)
84 color
= int(obj
['color'][0]), int(obj
['color'][1]), int(obj
['color'][2])
85 maxlen
= int(obj
['maxlen'])
86 space
= int(obj
['space'])
87 width
= int(obj
['width'])
88 GUI
.append(gui
.List(name
, xpos
, ypos
, layer
, fonts
[obj
['font']], color
, maxlen
, space
, width
, listbar
))
89 GUI
[-1].contentkey
= contentkey
91 GUI
[-1].fxspeed
= fxspeed