We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use a Queue rather than a string to handle the actions may be more adapted (L118)
Queue
actions
It's clearer and you can get rid of ACTION_SIZE and i logic.
ACTION_SIZE
i
Here is an example on how you would handle it:
from queue import Queue def __init__(self, *args, **kwargs): self.actions = Queue() def do_actions(self): while not self.actions.empty(): action = self.actions.get() # do something with action def add_action(action): self.actions.put(action) # instead of self.actions += action
This is also much easier to make thread-proof in the future, when you have ATMs with octo-cores... 😁
The text was updated successfully, but these errors were encountered:
Note on using Queue, it might be better to use six.moves Queue (for py2 & py3 compatibility).
eg: rtu-dataframe/escposprinter@4e13ee2
Sorry, something went wrong.
I wasn't aware you needed compatibility with Python 2. In that case, yes use six.moves.
six.moves
Using Enum in #4 may also be problematic. I would write a simple Enum class for Python 2 in this case.
Enum
Resolve #1, resolve #3, resolve #4 and resolve #5
55bf632
cc5ff6d
No branches or pull requests
Use a
Queue
rather than a string to handle theactions
may be more adapted (L118)It's clearer and you can get rid of
ACTION_SIZE
andi
logic.Here is an example on how you would handle it:
The text was updated successfully, but these errors were encountered: