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

def obnamlib::repo::Repository::get_format_version (   self )
Return (major, minor) of the on-disk format version.

If on-disk repository does not have a version yet, return None.

Definition at line 264 of file repo.py.

                                :
        '''Return (major, minor) of the on-disk format version.
        
        If on-disk repository does not have a version yet, return None.
        
        '''
        
        if self.fs.exists('metadata/format'):
            data = self.fs.cat('metadata/format')
            lines = data.splitlines()
            line = lines[0]
            try:
                version = int(line)
            except ValueError, e: # pragma: no cover
                msg = ('Invalid repository format version (%s) -- '
                            'forgot encryption?' %
                       repr(line))
                raise obnamlib.Error(msg)
            return version
        else:
            return None
        

Generated by  Doxygen 1.6.0   Back to index