X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=python%2Fcumulus%2F__init__.py;h=ff811b0a34fb2d487d9f4bc137913f724f22685d;hb=96894619b609626621a05b87638b40cdc7dbfe37;hp=b120436bf958b68c6d9711fb488e2dfd0d0a21e6;hpb=81b1c38dbd530d3be599605d3241089780bd9141;p=cumulus.git diff --git a/python/cumulus/__init__.py b/python/cumulus/__init__.py index b120436..ff811b0 100644 --- a/python/cumulus/__init__.py +++ b/python/cumulus/__init__.py @@ -1,7 +1,7 @@ -"""High-level interface for working with LBS archives. +"""High-level interface for working with Cumulus archives. This module provides an easy interface for reading from and manipulating -various parts of an LBS archive: +various parts of a Cumulus archive: - listing the snapshots and segments present - reading segment contents - parsing snapshot descriptors and snapshot metadata logs @@ -15,7 +15,7 @@ from pysqlite2 import dbapi2 as sqlite3 import cumulus.store, cumulus.store.file # The largest supported snapshot format that can be understood. -FORMAT_VERSION = (0, 8) # LBS Snapshot v0.8 +FORMAT_VERSION = (0, 11) # Cumulus Snapshot v0.11 # Maximum number of nested indirect references allowed in a snapshot. MAX_RECURSION_DEPTH = 3 @@ -27,7 +27,7 @@ accessed_segments = set() # filename extensions. These are listed in priority order (methods earlier in # the list are tried first). SEGMENT_FILTERS = [ - (".gpg", "lbs-filter-gpg --decrypt"), + (".gpg", "cumulus-filter-gpg --decrypt"), (".gz", "gzip -dc"), (".bz2", "bzip2 -dc"), ] @@ -60,7 +60,7 @@ CHECKSUM_ALGORITHMS = { } class ChecksumCreator: - """Compute an LBS checksum for provided data. + """Compute a Cumulus checksum for provided data. The algorithm used is selectable, but currently defaults to sha1. """ @@ -119,6 +119,9 @@ class LowlevelDataStore: return (t, filename) return (None, filename) + def scan(self): + self.store.scan() + def lowlevel_open(self, filename): """Return a file-like object for reading data from the given file.""" @@ -321,7 +324,7 @@ def parse_full(lines): def parse_metadata_version(s): """Convert a string with the snapshot version format to a tuple.""" - m = re.match(r"^LBS Snapshot v(\d+(\.\d+)*)$", s) + m = re.match(r"^(?:Cumulus|LBS) Snapshot v(\d+(\.\d+)*)$", s) if m is None: return () else: @@ -679,7 +682,7 @@ class LocalDatabase: """ # The expired column of the block_index table is used when generating a - # new LBS snapshot. A null value indicates that an object may be + # new Cumulus snapshot. A null value indicates that an object may be # re-used. Otherwise, an object must be written into a new segment if # needed. Objects with distinct expired values will be written into # distinct segments, to allow for some grouping by age. The value 0 is