Skip to content

Commit

Permalink
Remove unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cydanil committed Jul 11, 2021
1 parent 288955b commit 4949552
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import array
import os.path
import re
import string

from gourmand import check_encodings, convert
from gourmand.gdebug import TimeAction, debug
from gourmand.importers import importer, plaintext_importer

#from gourmand.gglobals import gt

class mmf_constants:
def __init__ (self):
Expand Down
43 changes: 21 additions & 22 deletions src/gourmand/plugins/import_export/pdf_plugin/pdf_exporter.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
import math
import os.path
import re
import tempfile
import types
import webbrowser
import xml.sax.saxutils
from gettext import ngettext
from io import BytesIO

import reportlab
import reportlab.lib.colors as colors
import reportlab.lib.fonts as fonts
import reportlab.lib.pagesizes as pagesizes
import reportlab.lib.styles as styles
import reportlab.lib.units as units
from reportlab.lib import colors, pagesizes, styles
import reportlab.platypus as platypus
from gi.repository import Gtk
from reportlab.lib.units import inch, mm
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfgen import canvas
from reportlab.platypus.flowables import ParagraphAndImage

import gourmand.exporters.exporter as exporter
from gourmand import convert, gglobals, image_utils
from gourmand import convert, gglobals
from gourmand.gtk_extras import cb_extras
from gourmand.gtk_extras import dialog_extras as de
from gourmand.gtk_extras import optionTable
Expand All @@ -31,27 +18,39 @@

from .page_drawer import PageDrawer

DEFAULT_PDF_ARGS = {'bottom_margin': 72, 'pagesize': 'letter', 'right_margin': 72, 'top_margin': 72, 'left_margin': 72, 'pagemode': 'portrait', 'base_font_size': 10, 'mode': ('column', 1)}
DEFAULT_PDF_ARGS = {
'bottom_margin': 72,
'pagesize': 'letter',
'right_margin': 72,
'top_margin': 72,
'left_margin': 72,
'pagemode': 'portrait',
'base_font_size': 10,
'mode': ('column', 1),
}


# Code for MCLine from:
# http://two.pairlist.net/pipermail/reportlab-users/2005-February/003695.html
class MCLine(platypus.Flowable):
"""Line flowable --- draws a line in a flowable"""
"""Line flowable.
Draw a line in a flowable. Code for MCLine from:
http://two.pairlist.net/pipermail/reportlab-users/2005-February/003695.html
"""

def __init__(self,width):
def __init__(self, width):
platypus.Flowable.__init__(self)
self.width = width

def __repr__(self):
return "Line(w=%s)" % self.width

def draw(self):
self.canv.line(0,0,self.width,0)
self.canv.line(0, 0, self.width, 0)


class Star (platypus.Flowable):
'''A hand flowable.'''
def __init__(self, size=None, fillcolor=colors.tan, strokecolor=colors.green):
from reportlab.lib.units import inch
if size is None: size=12 # 12 point
self.fillcolor, self.strokecolor = fillcolor, strokecolor
self.size = size
Expand Down

0 comments on commit 4949552

Please sign in to comment.