'Returns numerical version of the specified item.
For example, if kind is "chain" and the current chain link
points to a file named "chain7.pem", returns the integer 7.
:param str kind: the lineage member item ("cert", "privkey",
"chain", or "fullchain")
:returns: the current version of the specified member.
:rtype: int'

def current_version(self, kind):

    if (kind not in ALL_FOUR):
        raise errors.CertStorageError('unknown    kind    of    item')
    pattern = re.compile('^{0}([0-9]+)\\.pem$'.format(kind))
    target = self.current_target(kind)
    if ((target is None) or (not os.path.exists(target))):
        logger.debug('Current-version    target    for    %s    does    not    exist    at    %s.', kind, target)
        target = ''
    matches = pattern.match(os.path.basename(target))
    if matches:
        return int(matches.groups()[0])
    else:
        logger.debug('No    matches    for    target    %s.', kind)
        return None
