Back to index

freevial  1.2
Public Member Functions | Public Attributes
skinner.Skin Class Reference

List of all members.

Public Member Functions

def __init__
def set_domain
def configGet
def configGetInt
def configGetFloat
def configGetBool
def configGetEval
def configGetRGB
def LoadImage
def LoadImageRange
def LoadSound
def preguntadorCarregaFiguretes
def search_font_name
def render_text
def teamsGuanyador

Public Attributes

 defconfig
 config
 domain
 mostra_punt_de_categoria
 figureta_no
 figureta_si
 match_point

Detailed Description

Definition at line 67 of file skinner.py.


Constructor & Destructor Documentation

def skinner.Skin.__init__ (   self)

Definition at line 69 of file skinner.py.

00069 
00070        def __init__( self ):
00071               
00072               self.defconfig = SafeConfigParser()
00073               self.defconfig.readfp(open(default_file, 'r'))                        
00074               
00075               self.config = SafeConfigParser()
00076               self.config.readfp(open(Global.skin_file, 'r'))  
00077               
00078               Global.skin_folder = Global.skin_folder
00079 
00080               fontname = self.search_font_name('' )
00081               if fontname != '':
00082                      set_default_font( fontname )
       

Member Function Documentation

def skinner.Skin.configGet (   self,
  field,
  domain = None 
)

Definition at line 86 of file skinner.py.

00086 
00087        def configGet( self, field, domain = None ):
00088               
00089               try:
00090                      text = self.config.get( domain if domain else self.domain, field )
00091               
00092               except (NoOptionError, NoSectionError):
00093                      try:
00094                             text = self.defconfig.get( domain if domain else self.domain, field )
00095                      except (NoOptionError, NoSectionError):
00096                             text = 0
00097               
00098               return text
       

Here is the caller graph for this function:

def skinner.Skin.configGetBool (   self,
  field,
  domain = None 
)

Definition at line 105 of file skinner.py.

00105 
00106        def configGetBool( self, field, domain = None ):
00107               return True if self.configGet( field, domain ) == "True" else False

Here is the call graph for this function:

def skinner.Skin.configGetEval (   self,
  field,
  domain = None 
)

Definition at line 108 of file skinner.py.

00108 
00109        def configGetEval( self, field, domain = None ): 
00110               toeval = self.configGet( field, domain )
00111               return eval( toeval ) 

Here is the call graph for this function:

Here is the caller graph for this function:

def skinner.Skin.configGetFloat (   self,
  field,
  domain = None 
)

Definition at line 102 of file skinner.py.

00102 
00103        def configGetFloat( self, field, domain = None ):       
00104               return float( self.configGet( field, domain ) ) 
       

Here is the call graph for this function:

Here is the caller graph for this function:

def skinner.Skin.configGetInt (   self,
  field,
  domain = None 
)

Definition at line 99 of file skinner.py.

00099 
00100        def configGetInt( self, field, domain = None ):  
00101               return int( self.configGet( field, domain ) ) 
       

Here is the call graph for this function:

Here is the caller graph for this function:

def skinner.Skin.configGetRGB (   self,
  field,
  domain = None 
)

Definition at line 112 of file skinner.py.

00112 
00113        def configGetRGB( self, field, domain = None ):  
00114               return self.configGetEval( field, domain )
       

Here is the call graph for this function:

def skinner.Skin.LoadImage (   self,
  field,
  domain = None 
)

Definition at line 115 of file skinner.py.

00115 
00116        def LoadImage( self, field, domain = None ):
00117               
00118               name = self.configGet( field, domain )
00119               fullname = os.path.join( Global.skin_folder, name )
00120               
00121               if os.path.exists( fullname ):
00122                      retval = loadImage( fullname )
00123               else:
00124                      retval = loadImage( name )
00125               
00126               return retval
       

Here is the call graph for this function:

def skinner.Skin.LoadImageRange (   self,
  name,
  maxrange,
  digits,
  domain = None 
)

Definition at line 127 of file skinner.py.

00127 
00128        def LoadImageRange( self, name, maxrange, digits, domain = None ):
00129               
00130               torna = range(0, maxrange)
00131               pos = self.configGet( name, domain )
00132               
00133               for num in range(0, 64):
00134                      torna[num] = loadImage(pos + str( num ).zfill(digits) + '.png')
00135               
00136               return torna
       

Here is the call graph for this function:

def skinner.Skin.LoadSound (   self,
  name,
  volume,
  music = 0,
  domain = None 
)

Definition at line 137 of file skinner.py.

00137 
00138        def LoadSound( self, name, volume, music = 0, domain = None ):
00139               
00140               name = self.configGet( name, domain )
00141               volume = self.configGetFloat( volume, domain )
00142               
00143               fullname = os.path.join( Global.skin_folder, name )
00144               
00145               return loadSound( fullname if os.path.exists( fullname ) else name, volume = volume, music = music )

Here is the call graph for this function:

def skinner.Skin.preguntadorCarregaFiguretes (   self,
  joc,
  selcat 
)

Definition at line 146 of file skinner.py.

00146 
00147        def preguntadorCarregaFiguretes( self, joc, selcat ):
00148               self.mostra_punt_de_categoria = True
00149               self.figureta_no = loadImage('points/freevial_tot' + str( joc.teams[joc.current_team].figureta).zfill(2) + '.png')
00150               self.figureta_si = loadImage('points/freevial_tot' + str( joc.teams[joc.current_team].figureta | bitCategoria ( selcat )).zfill(2) + '.png')
00151               self.match_point = True if (joc.teams[joc.current_team].figureta | bitCategoria ( selcat ) == 63) else False

def skinner.Skin.render_text (   self,
  cadena,
  color,
  mida,
  antialias = 0,
  nomfont = '',
  maxwidth = 0 
)

Definition at line 166 of file skinner.py.

00166 
00167        def render_text( self, cadena, color, mida, antialias = 0, nomfont = '', maxwidth = 0 ):
00168 
00169               nomfont == self.search_font_name( nomfont )
00170 
00171               return render_text( cadena, color, mida, antialias, nomfont, maxwidth )             

Here is the call graph for this function:

def skinner.Skin.search_font_name (   self,
  nomfont 
)

Definition at line 152 of file skinner.py.

00152 
00153        def search_font_name( self, nomfont ):
00154 
00155               if nomfont == '':
00156                      nomfont = self.configGet( 'default_font', 'game' )
00157 
00158               if nomfont != '':
00159                      if not os.path.exists( nomfont ):
00160                             fullname = os.path.join( unicode(Global.skin_folder, 'utf-8'), nomfont)      
00161 
00162                             if os.path.exists( fullname ):
00163                                    nomfont = fullname
00164 
00165               return nomfont

Here is the call graph for this function:

Here is the caller graph for this function:

def skinner.Skin.set_domain (   self,
  domain 
)

Definition at line 83 of file skinner.py.

00083 
00084        def set_domain( self, domain ):
00085               self.domain = domain
       
def skinner.Skin.teamsGuanyador (   self,
  teams 
)

Definition at line 172 of file skinner.py.

00172 
00173        def teamsGuanyador( self, teams ):
00174        
00175               return teamsGuanyador( teams, self.configGetInt("game_mode", "game") , self.configGetInt("game_limit", "game"))

Here is the call graph for this function:


Member Data Documentation

Definition at line 74 of file skinner.py.

Definition at line 71 of file skinner.py.

Definition at line 84 of file skinner.py.

Definition at line 148 of file skinner.py.

Definition at line 149 of file skinner.py.

Definition at line 150 of file skinner.py.

Definition at line 147 of file skinner.py.


The documentation for this class was generated from the following file: