Skip to content

Commit 3a8d1e6

Browse files
committed
Apply feedback to adjustments
1 parent 91c2675 commit 3a8d1e6

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

printing/paper

+5-8
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ def view(args):
4343
print(bold(red("Group accounts can't print. Sorry!")))
4444

4545

46-
def adjust(args, type):
46+
def adjust(args):
4747
payload = Payload(
4848
user=args.user,
4949
time=datetime.now(),
5050
pages=args.pages,
51-
action=type,
51+
action=args.command,
5252
staffer=current_user(),
5353
reason=args.reason,
5454
)
5555

56-
stringtype = 'Refund' if type == 'refund' else 'Forward'
57-
prompt = bold(stringtype + ' {} pages to {}? [yN] '.format(payload.pages, payload.user))
56+
stringtype = 'Refund' if payload.action == 'refund' else 'Forward'
57+
prompt = bold('{} + {} pages to {}? [yN] '.format(stringtype, payload.pages, payload.user))
5858
if input(prompt) not in {'y', 'yes'}:
5959
print('Cancelled.')
6060
return
@@ -102,10 +102,7 @@ def main(argv=None):
102102
print(bold(red("The user {} doesn't exist.".format(args.user))))
103103
return 1
104104

105-
if args.command == 'refund' or args.command == 'forward':
106-
return commands[args.command](args, args.command)
107-
else:
108-
return commands[args.command](args)
105+
return commands[args.command](args)
109106

110107

111108
if __name__ == '__main__':

0 commit comments

Comments
 (0)