mirror of
https://github.com/entropia/paperless-asn-qr-codes.git
synced 2024-06-02 15:00:01 +00:00
Compare commits
3 commits
39117641bf
...
080c16784c
Author | SHA1 | Date | |
---|---|---|---|
080c16784c | |||
dd3b6b9b28 | |||
78c3041ce7 |
20
.github/workflows/lint.yaml
vendored
Normal file
20
.github/workflows/lint.yaml
vendored
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
name: Lint
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
lint:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- run: pipx install hatch
|
||||||
|
- run: hatch -e ci run ruff check paperless_asn_qr_codes
|
||||||
|
# temporary allow failures on pylint until we've fixed all issues
|
||||||
|
- run: hatch -e ci run pylint paperless_asn_qr_codes || exit 0
|
||||||
|
- run: hatch -e ci run black paperless_asn_qr_codes --check --diff
|
|
@ -1,11 +1,7 @@
|
||||||
import os
|
|
||||||
from dataclasses import dataclass, KW_ONLY
|
from dataclasses import dataclass, KW_ONLY
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from reportlab.pdfgen import canvas
|
from reportlab.pdfgen import canvas
|
||||||
from reportlab.lib.pagesizes import LETTER, A4
|
from reportlab.lib.pagesizes import LETTER, A4
|
||||||
from reportlab.lib.units import inch
|
|
||||||
from reportlab.pdfbase import pdfmetrics
|
|
||||||
from reportlab.pdfbase.ttfonts import TTFont
|
|
||||||
from reportlab.lib.units import mm
|
from reportlab.lib.units import mm
|
||||||
|
|
||||||
# Usage:
|
# Usage:
|
||||||
|
@ -116,9 +112,9 @@ class AveryLabel:
|
||||||
self.canvas.setLineCap(1)
|
self.canvas.setLineCap(1)
|
||||||
|
|
||||||
def topLeft(self, x=None, y=None):
|
def topLeft(self, x=None, y=None):
|
||||||
if x == None:
|
if x is None:
|
||||||
x = self.position
|
x = self.position
|
||||||
if y == None:
|
if y is None:
|
||||||
if self.topDown:
|
if self.topDown:
|
||||||
x, y = divmod(x, self.down)
|
x, y = divmod(x, self.down)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import argparse
|
import argparse
|
||||||
|
|
||||||
from reportlab.lib.units import mm, cm
|
from reportlab.lib.units import mm
|
||||||
from reportlab_qrcode import QRCodeImage
|
from reportlab_qrcode import QRCodeImage
|
||||||
from paperless_asn_qr_codes import avery_labels
|
from paperless_asn_qr_codes import avery_labels
|
||||||
|
|
||||||
|
@ -27,7 +27,9 @@ def main():
|
||||||
"--format", choices=avery_labels.labelInfo.keys(), default="averyL4731"
|
"--format", choices=avery_labels.labelInfo.keys(), default="averyL4731"
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--border", action='store_true', help="Display borders around labels, useful for debugging the printer alignment"
|
"--border",
|
||||||
|
action="store_true",
|
||||||
|
help="Display borders around labels, useful for debugging the printer alignment",
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
global startASN
|
global startASN
|
||||||
|
|
|
@ -28,6 +28,13 @@ dependencies = [
|
||||||
]
|
]
|
||||||
dynamic = ["version"]
|
dynamic = ["version"]
|
||||||
|
|
||||||
|
[project.optional-dependencies]
|
||||||
|
dev = [
|
||||||
|
"pylint",
|
||||||
|
"ruff",
|
||||||
|
"black",
|
||||||
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
Documentation = "https://github.com/entropia/paperless-asn-qr-codes#readme"
|
Documentation = "https://github.com/entropia/paperless-asn-qr-codes#readme"
|
||||||
Issues = "https://github.com/entropia/paperless-asn-qr-codes/issues"
|
Issues = "https://github.com/entropia/paperless-asn-qr-codes/issues"
|
||||||
|
@ -38,3 +45,8 @@ paperless-asn-qr-codes = "paperless_asn_qr_codes.main:main"
|
||||||
|
|
||||||
[tool.hatch.version]
|
[tool.hatch.version]
|
||||||
source = "vcs"
|
source = "vcs"
|
||||||
|
|
||||||
|
[tool.hatch.envs.ci]
|
||||||
|
features = [
|
||||||
|
"dev"
|
||||||
|
]
|
Loading…
Reference in a new issue