/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/bugtracker.py

  • Committer: Jelmer Vernooij
  • Date: 2018-11-17 01:04:53 UTC
  • mto: This revision was merged to the branch mainline in revision 7187.
  • Revision ID: jelmer@jelmer.uk-20181117010453-04oem8uwx2ni3j5v
Move decoding of bug properties.

Show diffs side-by-side

added added

removed removed

Lines of Context:
434
434
            raise InvalidBugUrl(url)
435
435
        lines.append('%s %s' % (url, tag))
436
436
    return '\n'.join(lines)
 
437
 
 
438
 
 
439
def decode_bug_urls(bug_text):
 
440
    """Decode a bug property text.
 
441
 
 
442
    :param bug_text: Contents of a bugs property
 
443
    :return: iterator over (url, status) tuples
 
444
    """
 
445
    for line in bug_text.splitlines():
 
446
        try:
 
447
            url, status = line.split(None, 2)
 
448
        except ValueError:
 
449
            raise InvalidLineInBugsProperty(line)
 
450
        if status not in ALLOWED_BUG_STATUSES:
 
451
            raise InvalidBugStatus(status)
 
452
        yield url, status