Update of /cvsroot/freevo/freevo/src/skins/main
In directory sc8-pr-cvs1:/tmp/cvs-serv12256

Modified Files:
        info_area.py 
Log Message:
support for function calls (e.g. comingup)

Index: info_area.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/skins/main/info_area.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** info_area.py        10 Jan 2004 16:53:22 -0000      1.10
--- info_area.py        11 Jan 2004 10:57:58 -0000      1.11
***************
*** 10,13 ****
--- 10,16 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.11  2004/01/11 10:57:58  dischi
+ # support for function calls (e.g. comingup)
+ #
  # Revision 1.10  2004/01/10 16:53:22  dischi
  # make eval more secure (and remove trailing whitespaces)
***************
*** 57,68 ****
  #endif
  
  from area import Skin_Area
  from skin_utils import *
  import xml_skin
- import copy
  from area import Geometry
  
  import traceback
  
  class Info_Area(Skin_Area):
      """
--- 60,76 ----
  #endif
  
+ import copy
+ import util
+ 
  from area import Skin_Area
  from skin_utils import *
  import xml_skin
  from area import Geometry
  
  import traceback
  
+ # function calls to get more info from the skin
+ function_calls = { 'comingup': util.comingup }
+ 
  class Info_Area(Skin_Area):
      """
***************
*** 220,223 ****
--- 228,234 ----
                  exp += ' %s' % ( b )
  
+             elif b.startswith('function:'):
+                 exp += ' %s()' % b[9:]
+                 
              elif b[ :4 ] == 'len(' and b.find( ')' ) > 0 and \
                       len(b) - b.find(')') < 5:
***************
*** 261,265 ****
  
                  # Evaluate the expression:
!                 if exp and eval(exp, {'attr': item.getattr}, {}):
                      # It's true, we should recurse into children
                      ret_list += self.eval_expressions( list[ i ].content, index + [ 
i ] )
--- 272,276 ----
  
                  # Evaluate the expression:
!                 if exp and eval(exp, {'attr': item.getattr}, function_calls):
                      # It's true, we should recurse into children
                      ret_list += self.eval_expressions( list[ i ].content, index + [ 
i ] )
***************
*** 277,281 ****
                      # evaluate the expression:
                      if exp:
!                         exp = eval(exp, {'attr': item.getattr}, {})
                          if exp:
                              list[ i ].text = str( exp )
--- 288,292 ----
                      # evaluate the expression:
                      if exp:
!                         exp = eval(exp, {'attr': item.getattr}, function_calls)
                          if exp:
                              list[ i ].text = str( exp )




-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to