Package pypln :: Package stores :: Module filestore :: Class FS
[hide private]

Class FS

source code


Instance Methods [hide private]
 
__init__(self, database, host='127.0.0.1', port=27017, usr=None, pw=None, create=False, logger=None)
Sets up a connection to a gridFS on a given database if the database does not exist and create=True, the Database is also created :param Database: Database on which to look for GridFS :param host: Host of the MongoDB :param port: Port of MongoDB :param usr: user authorized for the connection :param pw: password for the authorized user :param create: whether to create a file storage if it doesn't exist
source code
 
_rename(self, fn)
Get a filename to rename (try variations to find an available name) :return: filename
source code
 
add_file(self, fname)
Add a file to the collection :Parameters:
source code
 
drop(self)
Drop the file storage
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, database, host='127.0.0.1', port=27017, usr=None, pw=None, create=False, logger=None)
(Constructor)

source code 

Sets up a connection to a gridFS on a given database if the database does not exist and create=True, the Database is also created :param Database: Database on which to look for GridFS :param host: Host of the MongoDB :param port: Port of MongoDB :param usr: user authorized for the connection :param pw: password for the authorized user :param create: whether to create a file storage if it doesn't exist

Overrides: object.__init__

add_file(self, fname)

source code 

Add a file to the collection :Parameters:

  • fname: filename