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

def obnamlib::repo::Repository::genspec (   self,
  spec 
)
Interpret a generation specification.

Definition at line 641 of file repo.py.

                           :
        '''Interpret a generation specification.'''

        self.require_open_client()
        gens = self.list_generations()
        if not gens:
            raise obnamlib.Error('No generations')
        if spec == 'latest':
            return gens[-1]
        else:
            try:
                intspec = int(spec)
            except ValueError:
                raise obnamlib.Error('Generation %s is not an integer' % spec)
            if intspec in gens:
                return intspec
            else:
                raise obnamlib.Error('Generation %s not found' % spec)

Generated by  Doxygen 1.6.0   Back to index