fotolab 0.31.16__tar.gz → 0.32.0__tar.gz

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.
Files changed (42) hide show
  1. {fotolab-0.31.16/src/fotolab.egg-info → fotolab-0.32.0}/PKG-INFO +15 -1
  2. {fotolab-0.31.16 → fotolab-0.32.0}/pyproject.toml +26 -10
  3. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/auto.py +18 -3
  4. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/watermark.py +5 -3
  5. {fotolab-0.31.16 → fotolab-0.32.0/src/fotolab.egg-info}/PKG-INFO +15 -1
  6. fotolab-0.32.0/src/fotolab.egg-info/requires.txt +18 -0
  7. fotolab-0.31.16/src/fotolab.egg-info/requires.txt +0 -1
  8. {fotolab-0.31.16 → fotolab-0.32.0}/LICENSE.md +0 -0
  9. {fotolab-0.31.16 → fotolab-0.32.0}/README.md +0 -0
  10. {fotolab-0.31.16 → fotolab-0.32.0}/setup.cfg +0 -0
  11. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/__init__.py +0 -0
  12. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/__main__.py +0 -0
  13. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/cli.py +0 -0
  14. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/__init__.py +0 -0
  15. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/animate.py +0 -0
  16. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/border.py +0 -0
  17. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/contrast.py +0 -0
  18. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/env.py +0 -0
  19. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/halftone.py +0 -0
  20. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/info.py +0 -0
  21. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/montage.py +0 -0
  22. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/resize.py +0 -0
  23. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/rotate.py +0 -0
  24. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab/subcommands/sharpen.py +0 -0
  25. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab.egg-info/SOURCES.txt +0 -0
  26. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab.egg-info/dependency_links.txt +0 -0
  27. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab.egg-info/entry_points.txt +0 -0
  28. {fotolab-0.31.16 → fotolab-0.32.0}/src/fotolab.egg-info/top_level.txt +0 -0
  29. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_animate_subcommand.py +0 -0
  30. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_auto_subcommand.py +0 -0
  31. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_border_subcommand.py +0 -0
  32. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_contrast_subcommand.py +0 -0
  33. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_env_subcommand.py +0 -0
  34. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_halftone_subcommand.py +0 -0
  35. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_help_flag.py +0 -0
  36. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_info_subcommand.py +0 -0
  37. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_montage_subcommand.py +0 -0
  38. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_quiet_flag.py +0 -0
  39. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_resize_subcommand.py +0 -0
  40. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_rotate_subcommand.py +0 -0
  41. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_sharpen_subcommand.py +0 -0
  42. {fotolab-0.31.16 → fotolab-0.32.0}/tests/test_watermark_subcommand.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fotolab
3
- Version: 0.31.16
3
+ Version: 0.32.0
4
4
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
5
5
  License-Expression: AGPL-3.0-or-later
6
6
  Project-URL: Changelog, https://github.com/kianmeng/fotolab/blob/master/CHANGELOG.md
@@ -20,6 +20,20 @@ Requires-Python: >=3.9
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE.md
22
22
  Requires-Dist: pillow
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest; extra == "test"
25
+ Requires-Dist: pytest-cov; extra == "test"
26
+ Requires-Dist: pytest-randomly; extra == "test"
27
+ Requires-Dist: pytest-xdist; extra == "test"
28
+ Requires-Dist: scripttest; extra == "test"
29
+ Provides-Extra: doc
30
+ Requires-Dist: myst-parser; extra == "doc"
31
+ Requires-Dist: sphinx; extra == "doc"
32
+ Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
33
+ Requires-Dist: sphinx-copybutton; extra == "doc"
34
+ Provides-Extra: lint
35
+ Requires-Dist: pre-commit; extra == "lint"
36
+ Requires-Dist: ruff; extra == "lint"
23
37
  Dynamic: license-file
24
38
 
25
39
  # fotolab
@@ -7,7 +7,7 @@ where = ["src"]
7
7
 
8
8
  [project]
9
9
  name = "fotolab"
10
- version = "0.31.16"
10
+ version = "0.32.0"
11
11
  authors = [{name = "Kian-Meng Ang", email = "kianmeng@cpan.org"}]
12
12
  requires-python = ">=3.9"
13
13
  readme = "README.md"
@@ -37,25 +37,41 @@ Source = "https://github.com/kianmeng/fotolab"
37
37
  [project.scripts]
38
38
  fotolab = "fotolab.cli:main"
39
39
 
40
- [dependency-groups]
41
- dev = [
42
- "exceptiongroup",
43
- "importlib-metadata",
44
- "myst-parser",
45
- "nox",
46
- "pre-commit",
40
+ [project.optional-dependencies]
41
+ test = [
47
42
  "pytest",
48
43
  "pytest-cov",
49
44
  "pytest-randomly",
50
45
  "pytest-xdist",
51
- "ruff",
52
46
  "scripttest",
47
+ ]
48
+
49
+ doc = [
50
+ "myst-parser",
53
51
  "sphinx",
54
52
  "sphinx-autodoc-typehints",
55
53
  "sphinx-copybutton",
56
- "tomli",
54
+ ]
55
+
56
+ lint = [
57
+ "pre-commit",
58
+ "ruff",
57
59
  ]
58
60
 
59
61
  # verify through: uv run ruff check --show-settings
60
62
  [tool.ruff]
61
63
  line-length = 79
64
+ target-version = "py310"
65
+ exclude = [
66
+ "docs/",
67
+ "docs/source/conf.py",
68
+ ]
69
+
70
+ [tool.ruff.lint]
71
+ extend-select = [
72
+ "E",
73
+ "W",
74
+ ]
75
+
76
+ [tool.ruff.lint.pydocstyle]
77
+ convention = "google"
@@ -43,6 +43,16 @@ def build_subparser(subparsers) -> None:
43
43
  metavar="IMAGE_FILENAMES",
44
44
  )
45
45
 
46
+ auto_parser.add_argument(
47
+ "-t",
48
+ "--text",
49
+ dest="text",
50
+ help="set the watermark text (default: '%(default)s')",
51
+ type=str,
52
+ default="kianmeng.org",
53
+ metavar="WATERMARK_TEXT",
54
+ )
55
+
46
56
 
47
57
  def run(args: argparse.Namespace) -> None:
48
58
  """Run auto subcommand.
@@ -60,7 +70,7 @@ def run(args: argparse.Namespace) -> None:
60
70
  "radius": 1,
61
71
  "percent": 100,
62
72
  "threshold": 2,
63
- "text": "kianmeng.org",
73
+ "text": f"{args.text if args.text else 'kianmeng.org'}",
64
74
  "position": "bottom-left",
65
75
  "font_size": 12,
66
76
  "font_color": "white",
@@ -69,13 +79,18 @@ def run(args: argparse.Namespace) -> None:
69
79
  "padding": 15,
70
80
  "camera": False,
71
81
  "canvas": False,
72
- "lowercase": False,
82
+ "lowercase": True,
73
83
  "before_after": False,
74
84
  "alpha": 128,
75
85
  }
76
- combined_args = argparse.Namespace(**vars(args), **extra_args)
86
+
87
+ # resolve error: argparse.Namespace() got multiple values for keyword
88
+ # argument 'text'
89
+ merged_args = {**vars(args), **extra_args}
90
+ combined_args = argparse.Namespace(**merged_args)
77
91
  combined_args.overwrite = True
78
92
  combined_args.open = False
93
+
79
94
  log.debug(args)
80
95
  log.debug(combined_args)
81
96
 
@@ -110,7 +110,8 @@ def build_subparser(subparsers: argparse._SubParsersAction) -> None:
110
110
  type=int,
111
111
  default=2,
112
112
  help=(
113
- "set the outline width of the watermark text (default: '%(default)s')"
113
+ "set the outline width of the watermark text "
114
+ "(default: '%(default)s')"
114
115
  ),
115
116
  metavar="OUTLINE_WIDTH",
116
117
  )
@@ -122,7 +123,8 @@ def build_subparser(subparsers: argparse._SubParsersAction) -> None:
122
123
  type=str,
123
124
  default="black",
124
125
  help=(
125
- "set the outline color of the watermark text (default: '%(default)s')"
126
+ "set the outline color of the watermark text "
127
+ "(default: '%(default)s')"
126
128
  ),
127
129
  metavar="OUTLINE_COLOR",
128
130
  )
@@ -325,7 +327,7 @@ def prepare_text(args: argparse.Namespace, image: Image.Image) -> str:
325
327
  if args.lowercase:
326
328
  text = text.lower()
327
329
 
328
- return text
330
+ return text.replace("\\n", "\n")
329
331
 
330
332
 
331
333
  def calc_font_size(image: Image.Image, args: argparse.Namespace) -> int:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fotolab
3
- Version: 0.31.16
3
+ Version: 0.32.0
4
4
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
5
5
  License-Expression: AGPL-3.0-or-later
6
6
  Project-URL: Changelog, https://github.com/kianmeng/fotolab/blob/master/CHANGELOG.md
@@ -20,6 +20,20 @@ Requires-Python: >=3.9
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE.md
22
22
  Requires-Dist: pillow
23
+ Provides-Extra: test
24
+ Requires-Dist: pytest; extra == "test"
25
+ Requires-Dist: pytest-cov; extra == "test"
26
+ Requires-Dist: pytest-randomly; extra == "test"
27
+ Requires-Dist: pytest-xdist; extra == "test"
28
+ Requires-Dist: scripttest; extra == "test"
29
+ Provides-Extra: doc
30
+ Requires-Dist: myst-parser; extra == "doc"
31
+ Requires-Dist: sphinx; extra == "doc"
32
+ Requires-Dist: sphinx-autodoc-typehints; extra == "doc"
33
+ Requires-Dist: sphinx-copybutton; extra == "doc"
34
+ Provides-Extra: lint
35
+ Requires-Dist: pre-commit; extra == "lint"
36
+ Requires-Dist: ruff; extra == "lint"
23
37
  Dynamic: license-file
24
38
 
25
39
  # fotolab
@@ -0,0 +1,18 @@
1
+ pillow
2
+
3
+ [doc]
4
+ myst-parser
5
+ sphinx
6
+ sphinx-autodoc-typehints
7
+ sphinx-copybutton
8
+
9
+ [lint]
10
+ pre-commit
11
+ ruff
12
+
13
+ [test]
14
+ pytest
15
+ pytest-cov
16
+ pytest-randomly
17
+ pytest-xdist
18
+ scripttest
@@ -1 +0,0 @@
1
- pillow
File without changes
File without changes
File without changes
File without changes