Back to index

freevial  1.2
Classes | Functions
skinner Namespace Reference

Classes

class  Skin

Functions

def setSkinName

Function Documentation

def skinner.setSkinName (   path)

Definition at line 39 of file skinner.py.

00039 
00040 def setSkinName( path ):
00041        
00042        basename = sys.argv[sys.argv.index( '--skin' ) + 1]
00043        
00044        if not os.path.isdir( path ) and not '/' in basename:
00045               
00046               # If the directory doesn't exist, and it contains no slashes,
00047               # guess that it's not a path but just the name of the wanted
00048               # skin, and try to find it.
00049               
00050               calculated_path = firstExistingDirectory( basename,
00051                      # Search directories:
00052                      '/usr/share/games/freevial/skins/', 
00053                      os.path.join(os.path.expanduser('~/'), '.freevial/skins/'),
00054                      os.path.abspath('../skins/') )
00055               
00056               if calculated_path:
00057                      path = calculated_path
00058        
00059        if not os.path.isdir( path ):
00060               print _('Could not find skin "%s"...') % unicode(path, 'utf-8')
00061               sys.exit( 1 )
00062        
00063        Global.skin_folder = path
00064        Global.skin_file = os.path.join( path, 'skin.ini' )
00065        
00066        print _('Loading skin "%s"...') % unicode(Global.skin_folder, 'utf-8')

Here is the call graph for this function: