fotolab 0.16.17__py2.py3-none-any.whl → 0.17.0__py2.py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
fotolab/__init__.py CHANGED
@@ -21,7 +21,7 @@ import subprocess
21
21
  import sys
22
22
  from pathlib import Path
23
23
 
24
- __version__ = "0.16.17"
24
+ __version__ = "0.17.0"
25
25
 
26
26
  log = logging.getLogger(__name__)
27
27
 
fotolab/cli.py CHANGED
@@ -154,7 +154,6 @@ def build_parser() -> argparse.ArgumentParser:
154
154
  def main(args: Optional[Sequence[str]] = None) -> None:
155
155
  """Run the main program flow."""
156
156
  args = args or sys.argv[1:]
157
- parsed_args = argparse.Namespace(debug=True)
158
157
  log.debug(args)
159
158
 
160
159
  try:
@@ -175,7 +174,7 @@ def main(args: Optional[Sequence[str]] = None) -> None:
175
174
  log.error(
176
175
  "error: %s",
177
176
  getattr(error, "message", str(error)),
178
- exc_info=getattr(parsed_args, "debug", True),
177
+ exc_info=("-d" in args or "--debug" in args),
179
178
  )
180
179
 
181
180
  raise SystemExit(1) from None
fotolab/info.py CHANGED
@@ -37,6 +37,15 @@ def build_subparser(subparsers) -> None:
37
37
  metavar="IMAGE_FILENAME",
38
38
  )
39
39
 
40
+ info_parser.add_argument(
41
+ "-s",
42
+ "--sort",
43
+ default=False,
44
+ action="store_true",
45
+ dest="sort",
46
+ help="show image info by sorted field name",
47
+ )
48
+
40
49
 
41
50
  def run(args: argparse.Namespace) -> None:
42
51
  """Run info subcommand.
@@ -53,6 +62,12 @@ def run(args: argparse.Namespace) -> None:
53
62
  exif = image._getexif()
54
63
  info = {ExifTags.TAGS.get(tag_id): exif.get(tag_id) for tag_id in exif}
55
64
 
56
- tag_name_width = max(map(len, info))
57
- for tag_name, tag_value in info.items():
65
+ filtered_info = {
66
+ key: value for key, value in info.items() if key is not None
67
+ }
68
+ if args.sort:
69
+ filtered_info = dict(sorted(filtered_info.items()))
70
+
71
+ tag_name_width = max(map(len, filtered_info))
72
+ for tag_name, tag_value in filtered_info.items():
58
73
  print(f"{tag_name:<{tag_name_width}}: {tag_value}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fotolab
3
- Version: 0.16.17
3
+ Version: 0.17.0
4
4
  Summary: A console program that manipulate images.
5
5
  Keywords: photography,photo
6
6
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
@@ -210,13 +210,14 @@ fotolab info -h
210
210
  <!--help-info !-->
211
211
 
212
212
  ```console
213
- usage: fotolab info [-h] IMAGE_FILENAME
213
+ usage: fotolab info [-h] [-s] IMAGE_FILENAME
214
214
 
215
215
  positional arguments:
216
216
  IMAGE_FILENAME set the image filename
217
217
 
218
218
  options:
219
219
  -h, --help show this help message and exit
220
+ -s, --sort show image info by sorted field name
220
221
  ```
221
222
 
222
223
  <!--help-info !-->
@@ -1,19 +1,19 @@
1
- fotolab/__init__.py,sha256=qP6gvbqFk1sDJ5TBEb93V94RXlDx6CLNo3Td6D-12nQ,2062
1
+ fotolab/__init__.py,sha256=UOgnK_au7TNhT6094s8NfKV5DiH27bdIqR4y7gWsLxA,2061
2
2
  fotolab/__main__.py,sha256=aboOURPs_snOXTEWYR0q8oq1UTY9e-NxCd1j33V0wHI,833
3
3
  fotolab/animate.py,sha256=ejimhTozo9DN7BbqqcV4x8zLnanZRKq1pxBBFeOdr6Q,2967
4
4
  fotolab/auto.py,sha256=1Toxe8pA_tq15g1-imMFuHf1L94Ac7EthPTu7E8SAzE,2217
5
5
  fotolab/border.py,sha256=5ch2d7LVPhB2OFuuXSW5ci6Cn967CPDQu0qSfaO7uMg,3591
6
- fotolab/cli.py,sha256=XENJqvvMxOTHVYfch8gZJhkzGxhex0LUAe75ISNNWPo,5032
6
+ fotolab/cli.py,sha256=_9OvqkzVGwoIMwJvj7I0OwME_W9YHTCpye-Qh9wvamA,4983
7
7
  fotolab/contrast.py,sha256=l7Bs5p8W8ypN9Cg3fFHnU-A20UwMKtjTiPk6D0PRwpM,2095
8
8
  fotolab/env.py,sha256=u63uuy1LG9bXy5Q-x1JfPiQaGCGwTYy-GJmWtzSkeFc,1477
9
- fotolab/info.py,sha256=DawXTQJiQDBwy0Ml5Ysk8MvKga3ikp_aIw73AR3LdZo,1687
9
+ fotolab/info.py,sha256=jZmzLAJVTmzwQ9fqmVDpX6cnSDmG7ASKReZ6ySrXT7g,2076
10
10
  fotolab/montage.py,sha256=lUVY-zDSH7mwH-s34_XefdNp7CoDJHkwpbTUGiyJGgs,2037
11
11
  fotolab/resize.py,sha256=cvPfh4wUfydM23Do7VnP6Bx2EqMHKfYFYrpiNhyWzCU,3259
12
12
  fotolab/rotate.py,sha256=l_vQgf0IcI8AR1TSVsk4PrMZtJ3j_wpU77rKiGJ-KTA,1715
13
13
  fotolab/sharpen.py,sha256=wUPtJdtB6mCRmcHrA0CoEVO0O0ROBJWhejTvUeL67QU,2655
14
14
  fotolab/watermark.py,sha256=JnCIB--WZ2COG1BNrFY14GaWznz7BqBlwOVz4uW8H3Q,6546
15
- fotolab-0.16.17.dist-info/entry_points.txt,sha256=mvw7AY_yZkIyjAxPtHNed9X99NZeLnMxEeAfEJUbrCM,44
16
- fotolab-0.16.17.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
17
- fotolab-0.16.17.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
18
- fotolab-0.16.17.dist-info/METADATA,sha256=f8SorvhIK70fPa4tyenLO4Nr6RN44gRtfu8wHQJaXk8,10549
19
- fotolab-0.16.17.dist-info/RECORD,,
15
+ fotolab-0.17.0.dist-info/entry_points.txt,sha256=mvw7AY_yZkIyjAxPtHNed9X99NZeLnMxEeAfEJUbrCM,44
16
+ fotolab-0.17.0.dist-info/LICENSE.md,sha256=tGtFDwxWTjuR9syrJoSv1Hiffd2u8Tu8cYClfrXS_YU,31956
17
+ fotolab-0.17.0.dist-info/WHEEL,sha256=Sgu64hAMa6g5FdzHxXv9Xdse9yxpGGMeagVtPMWpJQY,99
18
+ fotolab-0.17.0.dist-info/METADATA,sha256=9XkFUeq8inR_5aqNvJRhZzzn0MMeqS2BBb8g5jBVaAI,10608
19
+ fotolab-0.17.0.dist-info/RECORD,,