Logo Search packages:      
Sourcecode: balazar3 version File versions  Download package

def balazar3-0.1::tofu::SavedInAPath::load (   klass,
  filename,
  create = 1 
)

SavedInAPath.load(filename) -> SavedInAPath

This class method loads a SavedInAPath object from its file.

Definition at line 192 of file __init__.py.

00192                                        :
    """SavedInAPath.load(filename) -> SavedInAPath

This class method loads a SavedInAPath object from its file."""
    if ".." in filename: raise ValueError("Cannot have .. in filename (security reason)!")
    filename = filename.replace("/", os.sep)
    for p in path:
      file = os.path.join(p, klass.DIRNAME, filename + ".data")
      if os.path.exists(file):
        obj = cerealizer.loads(open(file, "rb").read())
        obj.loaded()
        klass._alls2[filename] = obj
        return obj
    if create: return klass(filename)
    
    #raise ValueError("No %s named %s" % (klass.__name__, filename))
  
  def save(self, filename = None):


Generated by  Doxygen 1.6.0   Back to index