aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rw-r--r--bin/shift.py6
-rw-r--r--bin/utils/cmd_line.py12
2 files changed, 9 insertions, 9 deletions
diff --git a/bin/shift.py b/bin/shift.py
index 94db333..b837c53 100644
--- a/bin/shift.py
+++ b/bin/shift.py
@@ -25,11 +25,11 @@ def _main_shift(
else:
image.save(output_path, output)
-def _parse_direction(s):
+def _parse_direction(src):
try:
- return Direction(s)
+ return Direction(src)
except ValueError:
- raise argparse.ArgumentTypeError('invalid direction: ' + s)
+ raise argparse.ArgumentTypeError('invalid direction: ' + src)
def _parse_args(args=sys.argv):
parser = argparse.ArgumentParser(
diff --git a/bin/utils/cmd_line.py b/bin/utils/cmd_line.py
index 6bfeafe..43f7bca 100644
--- a/bin/utils/cmd_line.py
+++ b/bin/utils/cmd_line.py
@@ -5,11 +5,11 @@
import argparse
-def parse_non_negative_integer(s):
+def parse_non_negative_integer(src):
try:
- x = int(s)
+ n = int(src)
except ValueError:
- raise argparse.ArgumentTypeError('must be a non-negative integer: ' + s)
- if x < 0:
- raise argparse.ArgumentTypeError('must be a non-negative integer: ' + s)
- return x
+ raise argparse.ArgumentTypeError('must be a non-negative integer: ' + src)
+ if n < 0:
+ raise argparse.ArgumentTypeError('must be a non-negative integer: ' + src)
+ return n