Update of /cvsroot/freevo/freevo/src/skins/main
In directory sc8-pr-cvs1:/tmp/cvs-serv4408
Modified Files:
main.py xml_skin.py
Log Message:
support for extra fxd files for plugins
Index: main.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skins/main/main.py,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** main.py 1 Jan 2004 12:26:15 -0000 1.28
--- main.py 5 Jan 2004 18:03:43 -0000 1.29
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.29 2004/01/05 18:03:43 dischi
+ # support for extra fxd files for plugins
+ #
# Revision 1.28 2004/01/01 12:26:15 dischi
# use pickle to cache parsed skin files
***************
*** 118,124 ****
# try to find the skin xml file
! if not self.settings.load(config.SKIN_XML_FILE):
print "skin not found, using fallback skin"
! self.settings.load('blue.fxd')
config.SKIN_XML_FILE = 'blue.fxd'
--- 121,127 ----
# try to find the skin xml file
! if not self.settings.load(config.SKIN_XML_FILE, clear=True):
print "skin not found, using fallback skin"
! self.settings.load('blue.fxd', clear=True)
config.SKIN_XML_FILE = 'blue.fxd'
***************
*** 164,171 ****
return None
# check if all files used by the skin are not newer than
# the cache file
ftime = os.stat(cache)[stat.ST_MTIME]
! for f in settings.fxd_files:
if os.stat(f)[stat.ST_MTIME] > ftime:
return None
--- 167,184 ----
return None
+ pdir = os.path.join(config.SHARE_DIR, 'skins/plugins')
+ if os.path.isdir(pdir):
+ ffiles = util.match_files(pdir, [ 'fxd' ])
+ else:
+ ffiles = []
+
+ for f in settings.fxd_files:
+ if not os.path.dirname(f).endswith(pdir):
+ ffiles.append(f)
+
# check if all files used by the skin are not newer than
# the cache file
ftime = os.stat(cache)[stat.ST_MTIME]
! for f in ffiles:
if os.stat(f)[stat.ST_MTIME] > ftime:
return None
***************
*** 219,224 ****
settings = xml_skin.XMLSkin()
! if not settings.load(filename, copy_content, clear=True):
return None
self.save_cache(settings, filename)
return settings
--- 232,238 ----
settings = xml_skin.XMLSkin()
! if not settings.load(filename, clear=True):
return None
+
self.save_cache(settings, filename)
return settings
Index: xml_skin.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skins/main/xml_skin.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** xml_skin.py 2 Jan 2004 14:29:44 -0000 1.25
--- xml_skin.py 5 Jan 2004 18:03:43 -0000 1.26
***************
*** 10,13 ****
--- 10,16 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.26 2004/01/05 18:03:43 dischi
+ # support for extra fxd files for plugins
+ #
# Revision 1.25 2004/01/02 14:29:44 dischi
# add border to font.h
***************
*** 879,883 ****
! def parse(self, freevo_type, scale, c_dir, copy_content):
for node in freevo_type.children:
if node.name == u'main':
--- 882,886 ----
! def parse(self, freevo_type, scale, c_dir):
for node in freevo_type.children:
if node.name == u'main':
***************
*** 1016,1020 ****
"""
# get args back
! (clear, copy_content, file, prepare) = fxd.getattr(None, 'args')
font_scale = attr_float(node, "fontscale", 1.0)
--- 1019,1023 ----
"""
# get args back
! (clear, file, prepare) = fxd.getattr(None, 'args')
font_scale = attr_float(node, "fontscale", 1.0)
***************
*** 1033,1051 ****
if include:
! if clear:
! self._layout = {}
! self._font = {}
! self._color = {}
! self._images = {}
! self._menuset = {}
! self._menu = {}
! self._popup = ''
! self._sets = {}
! self._mainmenu = MainMenu()
! self.skindirs = []
! self.fxd_files = []
! self.load(include, copy_content, prepare=False)
! self.parse(node, scale, os.path.dirname(file), copy_content)
if not os.path.dirname(file) in self.skindirs:
self.skindirs = [ os.path.dirname(file) ] + self.skindirs
--- 1036,1042 ----
if include:
! self.load(include, prepare=False)
! self.parse(node, scale, os.path.dirname(file))
if not os.path.dirname(file) in self.skindirs:
self.skindirs = [ os.path.dirname(file) ] + self.skindirs
***************
*** 1059,1066 ****
! def load(self, file, copy_content=0, prepare=True, clear=False):
"""
load and parse the skin file
"""
self.prepared = False
--- 1050,1076 ----
! def load(self, file, prepare=True, clear=False):
"""
load and parse the skin file
"""
+ if clear:
+ self._layout = {}
+ self._font = {}
+ self._color = {}
+ self._images = {}
+ self._menuset = {}
+ self._menu = {}
+ self._popup = ''
+ self._sets = {}
+ self._mainmenu = MainMenu()
+ self.skindirs = []
+ self.fxd_files = []
+
+ # load plugin skin files:
+ pdir = os.path.join(config.SHARE_DIR, 'skins/plugins')
+ if os.path.isdir(pdir):
+ for p in util.match_files(pdir, [ 'fxd' ]):
+ self.load(p, prepare=False)
+
self.prepared = False
***************
*** 1082,1086 ****
try:
parser = util.fxdparser.FXD(file)
! parser.setattr(None, 'args', (clear, copy_content, file, prepare))
parser.set_handler('skin', self.fxd_callback)
parser.parse()
--- 1092,1096 ----
try:
parser = util.fxdparser.FXD(file)
! parser.setattr(None, 'args', (clear, file, prepare))
parser.set_handler('skin', self.fxd_callback)
parser.parse()
-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog