[PIPE2D-813] Make str more useful for pfsConfig enums Created: 17/Apr/21 Updated: 18/Apr/21 Resolved: 18/Apr/21 |
|
| Status: | Done |
| Project: | DRP 2-D Pipeline |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Story | Priority: | Normal |
| Reporter: | rhl | Assignee: | rhl |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Story Points: | 1 |
| Sprint: | 2DDRP-2021 A 4 |
| Reviewers: | price |
| Description |
|
The str method of FiberStatus and TargetType return things like FiberStatus.BROKENFIBER; please change this to BROKENFIBER. If you want repr you know where to find it. |
| Comments |
| Comment by rhl [ 17/Apr/21 ] |
|
Trivial. |
| Comment by price [ 17/Apr/21 ] |
|
I'm not sure this is good ("BROKENFIBER" doesn't communicate that this is an enum instance rather than a string), but if it's what you want then OK. But why is this more involved than:
def __str__(self):
"""Stringify"""
return self.name
? |
| Comment by rhl [ 17/Apr/21 ] |
|
That's a much better implementation, I'll fix it. It's better because I want to ask what a fibre is, and don't care that it's an enum. If I want to know that, I'll use repr. |
| Comment by rhl [ 18/Apr/21 ] |
|
merged and pushed |