Function to create a new defect ID.
We're abandoning the mapping of defect names to IDs (Oct 2012).
Hence here we just ask for the first open gap in ID numbers.
It works for virtual IDs as well, though via a bit of an edge case for
when none exist yet.
Definition at line 48 of file ids.py.
49 defect_name: str, virtual: bool =
False) -> int:
51 Function to create a new defect ID.
53 We're abandoning the mapping of defect names to IDs (Oct 2012).
54 Hence here we just ask for the first open gap in ID numbers.
55 It works for virtual IDs as well, though via a bit of an edge case for
58 existing =
sorted(_
for _
in six.itervalues(existing_map)
if not isinstance(_, six.string_types))
59 if len(existing) == 0:
63 for i, v
in enumerate(existing[1:]):
68 newid = existing[-1] + 1
70 did.is_virtual=virtual
71 log.debug(
"Chose new id: %r", did)