Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.vfs.VfsFactory Class Reference

List of all members.

Public Member Functions

def __init__
def register
def new

Public Attributes


Detailed Description

Create new instances of VirtualFileSystem.

Definition at line 261 of file

Constructor & Destructor Documentation

Definition at line 265 of file

00266     def __init__(self):
00267         self.implementations = {}

Member Function Documentation

def (   self,
  create = False 
Create a new VFS appropriate for a given URL.

Definition at line 273 of file

00274     def new(self, url, create=False):
00275         '''Create a new VFS appropriate for a given URL.'''
00276         scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
00277         if scheme in self.implementations:
00278             klass, kwargs = self.implementations[scheme]
00279             return klass(url, create=create, **kwargs)
00280         raise obnamlib.Error('Unknown VFS type %s' % url)
def obnamlib.vfs.VfsFactory.register (   self,

Definition at line 268 of file

00269     def register(self, scheme, implementation, **kwargs):
00270         if scheme in self.implementations:
00271             raise obnamlib.Error('URL scheme %s already registered' % scheme)
00272         self.implementations[scheme] = (implementation, kwargs)

Member Data Documentation

Definition at line 266 of file

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