mirror of
https://github.com/pretix/pretix.git
synced 2026-05-04 15:04:03 +00:00
isort 5.0 config/docs (#1736)
This commit is contained in:
@@ -121,7 +121,7 @@ OPTIONS = OrderedDict([
|
||||
|
||||
|
||||
def render_pdf(event, positions, opt):
|
||||
from PyPDF2 import PdfFileWriter, PdfFileReader
|
||||
from PyPDF2 import PdfFileReader, PdfFileWriter
|
||||
Renderer._register_fonts()
|
||||
|
||||
renderermap = {
|
||||
|
||||
@@ -5,7 +5,6 @@ import mt940
|
||||
|
||||
from pretix.base.decimal import round_decimal
|
||||
|
||||
|
||||
"""
|
||||
The parse_transaction_details and join_reference functions are
|
||||
Copyright (c) 2017 Nicole Klünder
|
||||
|
||||
@@ -43,8 +43,8 @@ class ReportlabExportMixin:
|
||||
|
||||
@staticmethod
|
||||
def register_fonts():
|
||||
from reportlab.pdfbase.ttfonts import TTFont
|
||||
from reportlab.pdfbase import pdfmetrics
|
||||
from reportlab.pdfbase.ttfonts import TTFont
|
||||
|
||||
pdfmetrics.registerFont(TTFont('OpenSans', finders.find('fonts/OpenSans-Regular.ttf')))
|
||||
pdfmetrics.registerFont(TTFont('OpenSansIt', finders.find('fonts/OpenSans-Italic.ttf')))
|
||||
@@ -56,8 +56,8 @@ class ReportlabExportMixin:
|
||||
return BaseDocTemplate
|
||||
|
||||
def create(self, form_data):
|
||||
from reportlab.platypus import PageTemplate
|
||||
from reportlab.lib.units import mm
|
||||
from reportlab.platypus import PageTemplate
|
||||
|
||||
with tempfile.NamedTemporaryFile(suffix=".pdf") as f:
|
||||
Report.register_fonts()
|
||||
@@ -162,8 +162,8 @@ class OverviewReport(Report):
|
||||
return pagesizes.landscape(pagesizes.A4)
|
||||
|
||||
def get_story(self, doc, form_data):
|
||||
from reportlab.platypus import Paragraph, Spacer, TableStyle, Table
|
||||
from reportlab.lib.units import mm
|
||||
from reportlab.platypus import Paragraph, Spacer, Table, TableStyle
|
||||
|
||||
if form_data.get('date_from'):
|
||||
form_data['date_from'] = parse(form_data['date_from'])
|
||||
@@ -334,8 +334,8 @@ class OrderTaxListReportPDF(Report):
|
||||
return pagesizes.landscape(pagesizes.A4)
|
||||
|
||||
def get_story(self, doc, form_data):
|
||||
from reportlab.platypus import Paragraph, Spacer, TableStyle, Table
|
||||
from reportlab.lib.units import mm
|
||||
from reportlab.platypus import Paragraph, Spacer, Table, TableStyle
|
||||
|
||||
headlinestyle = self.get_style()
|
||||
headlinestyle.fontSize = 15
|
||||
|
||||
@@ -21,8 +21,9 @@ from pretix.presale.signals import html_head
|
||||
@receiver(register_payment_providers, dispatch_uid="payment_stripe")
|
||||
def register_payment_provider(sender, **kwargs):
|
||||
from .payment import (
|
||||
StripeSettingsHolder, StripeCC, StripeGiropay, StripeIdeal, StripeAlipay, StripeBancontact,
|
||||
StripeSofort, StripeEPS, StripeMultibanco, StripePrzelewy24, StripeWeChatPay
|
||||
StripeAlipay, StripeBancontact, StripeCC, StripeEPS, StripeGiropay,
|
||||
StripeIdeal, StripeMultibanco, StripePrzelewy24, StripeSettingsHolder,
|
||||
StripeSofort, StripeWeChatPay,
|
||||
)
|
||||
|
||||
return [
|
||||
|
||||
@@ -116,8 +116,8 @@ class PdfTicketOutput(BaseTicketOutput):
|
||||
return 'order%s%s.pdf' % (self.event.slug, order.code), 'application/pdf', outbuffer.read()
|
||||
|
||||
def _create_canvas(self, buffer):
|
||||
from reportlab.pdfgen import canvas
|
||||
from reportlab.lib import pagesizes
|
||||
from reportlab.pdfgen import canvas
|
||||
|
||||
# Doesn't matter as we'll overpaint it over a background later
|
||||
pagesize = pagesizes.A4
|
||||
|
||||
Reference in New Issue
Block a user