Skip to content

Change Item __repr__ to Subject/From #31

Closed
campb303 opened this issue Jun 10, 2021 · 1 comment · Fixed by #34
Closed

Change Item __repr__ to Subject/From #31

campb303 opened this issue Jun 10, 2021 · 1 comment · Fixed by #34
Assignees
Labels
enhancement Request for a change to existing functionality

Comments

@campb303
Copy link
Collaborator

Currently an item's representation when printed is just its queue name and number smashed together like ce1 or aae32. It would be more helpful to have the subject and from data available as well e.g.

from webqueue2api import Item
ce_1 = Item("ce", 1)
print(ce_1)
[ce1] From: campb303, Subject: Printer Issues
@campb303 campb303 added the enhancement Request for a change to existing functionality label Jun 10, 2021
@campb303 campb303 self-assigned this Jun 10, 2021
@campb303
Copy link
Collaborator Author

This has been fixed:

from webqueue2api import Item

item = Item("ce", 22)

# Old __repr__ output:
>>> print(item)
"ce22"

# New __repr__ output:
>>> print(item)
"[ce22] (awhelton) Laptop Battery Replacement"

Sign in to join this conversation on GitHub.
Labels
enhancement Request for a change to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant