Package moul :: Package file :: Module directory :: Class AbstractUruDirectory
[hide private]
[frames] | no frames]

Class AbstractUruDirectory



object --+
         |
        AbstractUruDirectory
Known Subclasses:
UruGameDataDirectory, UruPersonalDataDirectory

Abstract class for an Uru directory

Instance Methods [hide private]
  __init__(self, basepath)
Constructor
bool exists(self, name=None)
Check if directory with name exists.
str get(self, name=None)
Get complete path for name
  factory(self, name)
Factory - creates instances to handle subdirectories and files
  initializeFactories(self)
Create instance attributes with factory instances

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__


Class Variables [hide private]
dict _dirmapping = {}
A mapping of name → subpath
dict _factories = {}
A list of factories name → (callable, name tuples) _dirmapping

Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, basepath)
(Constructor)

 
Constructor
Parameters:
  • basepath (str) - absolute path to folder
Overrides: object.__init__

exists(self, name=None)

 
Check if directory with name exists.
Parameters:
  • name (str or None) - Name of the subdirectory or None for basedir
Returns: bool

get(self, name=None)

 
Get complete path for name
Parameters:
  • name (str or None) - Name of the subdirectory or None for basedir
Returns: str
absolute path

factory(self, name)

 
Factory - creates instances to handle subdirectories and files
Parameters:
  • name (str) - Factory name
Returns:
Factory instance

initializeFactories(self)

 
Create instance attributes with factory instances

Class Variable Details [hide private]

_dirmapping

A mapping of name → subpath
Type:
dict
Value:
{}                                                                     
      

_factories

A list of factories name → (callable, name tuples) _dirmapping
Type:
dict
Value:
{}