Skip to content
New issue

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

Refactor set_route_... and other action methods #1

Closed
0xjac opened this issue Jun 23, 2017 · 0 comments
Closed

Refactor set_route_... and other action methods #1

0xjac opened this issue Jun 23, 2017 · 0 comments

Comments

@0xjac
Copy link

0xjac commented Jun 23, 2017

There is some copy/paste on those set_route_... and other action methods (L334-L366).

Use a helper method instead:

class eSSP(object):

    def _action_helper(self, amount, currency, prefix, action):
        self.actions += action
        self.actions_args['{}_amount'.format(prefix)] = amount * 100
        self.actions_args['{}_currency'.format(prefix)] = currency.upper().encode()
        
    def set_route_cashbox(self, amount, currency="CHF"):
        """Set the bills <amount> in the cashbox
           NV11: Set the bills <= amount in the cashbox"""
        self._action_helper(amount, currency, 'routec', 'c')
@0xjac 0xjac mentioned this issue Jun 23, 2017
Minege added a commit that referenced this issue Jun 27, 2017
@Minege Minege closed this as completed in cc5ff6d Jul 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant