3.3. Utils¶
3.3.1. GSGW¶
3.3.2. GSGR¶
Example:
.. class SQLiteDatabase(object):
.. """
.. Example implementation of a database Connector,
.. which can be used to make run accept paths to
.. sqlite db files.
Example:
.. def _open(self, path):
.. if path.endswith('.gz'):
.. if self._indexed_gzip(path):
.. self.file_handler = indexedGzip.IndexedGzip(path, self.encoding)
.. else:
.. self.file_handler = standardGzip.StandardGzip(path, self.encoding)
.. # Insert a new condition to enable your new fileclass
.. elif path.endswith('.db'):
.. self.file_handler = utils.SQLiteConnector.SQLiteDatabase(path, self.encoding)
.. else:
.. self.file_handler = standardMzml.StandardMzml(path, self.encoding)
.. return self.file_handler