

def _guess_backup_protocol(self, number, client):
    'The :func:`burpui.misc.backend.burp2.Burp._guess_backup_protocol`\n        function helps you determine if the backup is protocol 2 or 1\n\n        :param number: Backup number to work on\n        :type number: int\n\n        :param client: Client name to work on\n        :type client: str\n\n        :returns: 1 or 2\n        '
    query = self.status('c:{0}:b:{1}:l:backup\n'.format(client, number))
    try:
        log = query['clients'][0]['backups'][0]['logs']['backup']
        for line in log:
            if re.search('Protocol: 2$', line):
                return 2
    except KeyError as e:
        return 1
    return 1

dataset/ETHPy150Open ziirish/burp-ui/burpui/misc/backend/burp2.py Burp._guess_backup_protocol/original