Package libconfix :: Package core :: Package filesys :: Module vfs_entry :: Class VFSEntry
[show private | hide private]
[frames | no frames]

Type VFSEntry

object --+
         |
        VFSEntry

Known Subclasses:
Entry, OverlayEntry, VFSDirectory, VFSFile

A directory entry a virtual file system.

This class is meant to be the base class for every object - file
or directory - in the game. As such, it provides the following
relations:

- parent; a back-reference to the entry's parent object, which is
  supposed to be of type VFSDirectory (actually, a derived
  instance).

- filesystem; a reference to the filesystem that owns this node.

The class also implements so-called properties. These are
name/value pairs, where name is a string, and value can be any
type.

Method Summary
  __init__(self)
  abspath(self)
Return the absolute path to this object.
  del_property(self, name)
  filesystem(self)
  get_property(self, name)
  is_persistent(self)
Does this entry correspond to a physical OS file system entry that can be accessed directly? This information is quite useful under certain circumstances; for example when it is better to pass the file to python's execfile(), rather than exec'ing it from memory (execfile() gives better error messages).
  name(self)
  parent(self)
  relpath(self, from_dir)
Return the relative path from dir to this object.
  set_filesystem(self, filesystem)
  set_parent(self, parent)
  set_property(self, name, value)
  sync(self)
Write back to the backing storage, whatever this means.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...
  __str__(x)
x.__str__() <==> str(x)...

Method Details

abspath(self)

Return the absolute path to this object.

is_persistent(self)

Does this entry correspond to a physical OS file system entry
that can be accessed directly?

This information is quite useful under certain circumstances;
for example when it is better to pass the file to python's
execfile(), rather than exec'ing it from memory (execfile()
gives better error messages).

relpath(self, from_dir)

Return the relative path from dir to this object.

sync(self)

Write back to the backing storage, whatever this means. To be
implemented by derived classes.

Generated by Epydoc 2.1 on Fri Nov 23 16:56:34 2007 http://epydoc.sf.net