Skip to content

Commit eba6a3b

Browse files
committed
Linting
1 parent 5cfb964 commit eba6a3b

12 files changed

Lines changed: 101 additions & 94 deletions

File tree

.vscode/launch.json

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
{
2-
"version": "0.2.0",
3-
"configurations": [
4-
{
5-
"name": "Debug Examples",
6-
"type": "debugpy",
7-
"request": "launch",
8-
"module": "pdfbaker",
9-
"args": ["bake", "examples/examples.yaml"],
10-
"console": "integratedTerminal"
11-
},
12-
{
13-
"name": "Debug Tests",
14-
"type": "debugpy",
15-
"request": "launch",
16-
"module": "pytest",
17-
"args": ["-v", "tests"],
18-
"console": "integratedTerminal"
19-
}
20-
]
21-
}
22-
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Debug Examples",
6+
"type": "debugpy",
7+
"request": "launch",
8+
"module": "pdfbaker",
9+
"args": ["bake", "examples/examples.yaml"],
10+
"console": "integratedTerminal"
11+
},
12+
{
13+
"name": "Debug Tests",
14+
"type": "debugpy",
15+
"request": "launch",
16+
"module": "pytest",
17+
"args": ["-v", "tests"],
18+
"console": "integratedTerminal"
19+
}
20+
]
21+
}

.vscode/tasks.json

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
{
2-
"version": "2.0.0",
3-
"tasks": [
4-
{
5-
"label": "Bake",
6-
"type": "shell",
7-
"command": "python -m pdfbaker bake ${input:configPath}",
8-
"group": "build",
9-
"presentation": {
10-
"reveal": "always",
11-
"panel": "new"
12-
}
13-
},
14-
{
15-
"label": "Run Tests",
16-
"type": "shell",
17-
"command": "pytest -v tests",
18-
"group": "test",
19-
"presentation": {
20-
"reveal": "always",
21-
"panel": "new"
22-
}
23-
},
24-
{
25-
"label": "Run Coverage",
26-
"type": "shell",
27-
"command": "pytest --cov=pdfbaker --cov-report=html",
28-
"group": "test",
29-
"presentation": {
30-
"reveal": "always",
31-
"panel": "new"
32-
}
33-
},
34-
{
35-
"label": "View Coverage",
36-
"type": "shell",
37-
"command": "python -c \"import webbrowser; webbrowser.open('htmlcov/index.html')\"",
38-
"presentation": {
39-
"reveal": "never",
40-
"panel": "new"
41-
}
42-
}
43-
],
44-
"inputs": [
45-
{
46-
"id": "configPath",
47-
"type": "promptString",
48-
"description": "Path to main YAML config file",
49-
"default": "examples/examples.yaml"
50-
}
51-
]
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Bake",
6+
"type": "shell",
7+
"command": "python -m pdfbaker bake ${input:configPath}",
8+
"group": "build",
9+
"presentation": {
10+
"reveal": "always",
11+
"panel": "new"
12+
}
13+
},
14+
{
15+
"label": "Run Tests",
16+
"type": "shell",
17+
"command": "pytest -v tests",
18+
"group": "test",
19+
"presentation": {
20+
"reveal": "always",
21+
"panel": "new"
22+
}
23+
},
24+
{
25+
"label": "Run Coverage",
26+
"type": "shell",
27+
"command": "pytest --cov=pdfbaker --cov-report=html",
28+
"group": "test",
29+
"presentation": {
30+
"reveal": "always",
31+
"panel": "new"
32+
}
33+
},
34+
{
35+
"label": "View Coverage",
36+
"type": "shell",
37+
"command": "python -c \"import webbrowser; webbrowser.open('htmlcov/index.html')\"",
38+
"presentation": {
39+
"reveal": "never",
40+
"panel": "new"
41+
}
42+
}
43+
],
44+
"inputs": [
45+
{
46+
"id": "configPath",
47+
"type": "promptString",
48+
"description": "Path to main YAML config file",
49+
"default": "examples/examples.yaml"
50+
}
51+
]
5252
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
title: "Custom Location Example"
22
description: "This page uses custom directory structure"
3-
template: "../other_templates/custom_page.svg.j2"
3+
template: "../other_templates/custom_page.svg.j2"

examples/custom_locations/other_templates/custom_page.svg.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<svg width="210mm" height="297mm" viewBox="0 0 210 297" version="1.1">
33
<text x="105" y="50" text-anchor="middle" font-size="20">{{ title }}</text>
44
<text x="105" y="80" text-anchor="middle" font-size="14">{{ description }}</text>
5-
</svg>
5+
</svg>

examples/custom_locations/your_directory/config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ pages:
66
# Path notation - uses custom location
77
- "../other_pages/custom_page.yaml"
88
# Custom images directory name and location
9-
images_dir: "../your_images"
9+
images_dir: "../your_images"
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
title: "Content Page"
2-
description: "This document is located in a nested directory structure, demonstrating how pdfbaker can handle documents located anywhere in your filesystem."
2+
description:
3+
"This document is located in a nested directory structure, demonstrating how pdfbaker
4+
can handle documents located anywhere in your filesystem."
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
title: "Custom Locations Example"
22
subtitle: "Mixing conventional and custom locations"
33
template: "templates/intro.svg.j2"
4-
# Uses conventional location (templates/intro.svg.j2)
4+
# Uses conventional location (templates/intro.svg.j2)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
title: "Standard Location Example"
22
subtitle: "This page uses conventional directory structure"
3-
template: "standard_page.svg.j2"
3+
template: "standard_page.svg.j2"

examples/custom_locations/your_directory/templates/standard_page.svg.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
<svg width="210mm" height="297mm" viewBox="0 0 210 297" version="1.1">
33
<text x="105" y="50" text-anchor="middle" font-size="20">{{ title }}</text>
44
<text x="105" y="80" text-anchor="middle" font-size="14">{{ subtitle }}</text>
5-
</svg>
5+
</svg>

src/pdfbaker/page.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,19 @@
1919
__all__ = ["PDFBakerPage"]
2020

2121

22+
# pylint: disable=too-few-public-methods
2223
class PDFBakerPage:
2324
"""A single page of a document."""
2425

2526
class Configuration(PDFBakerConfiguration):
2627
"""PDFBakerPage configuration."""
28+
2729
def __init__(
28-
self,
29-
base_config: dict[str, Any],
30-
config: Path,
31-
page: "PDFBakerPage",
32-
) -> None:
30+
self,
31+
base_config: dict[str, Any],
32+
config: Path,
33+
page: "PDFBakerPage",
34+
) -> None:
3335
"""Initialize page configuration (needs a template)."""
3436
self.page = page
3537
# FIXME: config is usually pages/mypage.yaml

0 commit comments

Comments
 (0)