Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some typing information to module froide.settings. #526

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion froide/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import re
from typing import List, Tuple

from django.utils.translation import gettext_lazy as _

Expand Down Expand Up @@ -627,6 +628,9 @@ class Dev(Base):
pass


FakePdf = Tuple[List[str], str]


class TestBase(Base):
DEBUG = False

Expand All @@ -644,7 +648,7 @@ def TEMPLATES(self):
TEMP[0]["OPTIONS"]["debug"] = True
return TEMP

def _fake_convert_pdf(self, infile, outpath):
def _fake_convert_pdf(self, infile: str, outpath: str) -> FakePdf:
_, filename = os.path.split(infile)
name, ext = filename.rsplit(".", 1)
output = os.path.join(outpath, "%s.pdf" % name)
Expand Down