Skip to content

Commit

Permalink
Use length-sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinThoma committed Sep 7, 2020
1 parent 20016a6 commit 55562e2
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 37 deletions.
1 change: 1 addition & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ indent=' '
multi_line_output=3
length_sort=0
include_trailing_comma=True
length_sort=True
12 changes: 6 additions & 6 deletions docs/_themes/flask_theme_support.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# flasky pygments style based on tango style
from pygments.style import Style
from pygments.token import (
Comment,
Name,
Error,
Other,
Number,
String,
Comment,
Generic,
Keyword,
Literal,
Name,
Number,
Operator,
Other,
Punctuation,
String,
Whitespace,
Punctuation,
)


Expand Down
9 changes: 4 additions & 5 deletions excalibur/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@

import click

from . import __version__
from . import settings, __version__
from . import configuration as conf
from . import settings
from .operators.python_operator import PythonOperator
from .tasks import extract, split
from .utils.database import initialize_database, reset_database
from .tasks import split, extract
from .www.app import create_app
from .utils.database import reset_database, initialize_database
from .operators.python_operator import PythonOperator


def abort_if_false(ctx, param, value):
Expand Down
6 changes: 3 additions & 3 deletions excalibur/executors/celery_executor.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import subprocess
import traceback
import subprocess

from celery import Celery

from .. import configuration as conf
from ..config_templates.default_celery import DEFAULT_CELERY_CONFIG
from ..utils.module_loading import import_string
from .base_executor import BaseExecutor
from ..utils.module_loading import import_string
from ..config_templates.default_celery import DEFAULT_CELERY_CONFIG

if conf.has_option("celery", "celery_config_options"):
celery_configuration = import_string(conf.get("celery", "celery_config_options"))
Expand Down
2 changes: 1 addition & 1 deletion excalibur/executors/sequential_executor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import subprocess
import traceback
import subprocess
from concurrent.futures import ProcessPoolExecutor

from .base_executor import BaseExecutor
Expand Down
10 changes: 5 additions & 5 deletions excalibur/models.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import datetime as dt
import json
import datetime as dt
from typing import Any # noqa

from sqlalchemy import (
Boolean,
Text,
Column,
String,
Boolean,
Integer,
DateTime,
ForeignKey,
Integer,
String,
Text,
)
from sqlalchemy.ext.declarative import declarative_base

Expand Down
4 changes: 2 additions & 2 deletions excalibur/settings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import atexit
import os
import atexit

from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy.pool import NullPool

from . import configuration as conf
Expand Down
10 changes: 5 additions & 5 deletions excalibur/tasks.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import datetime as dt
import os
import glob
import json
import logging
import os
import datetime as dt

from camelot.core import TableList
from camelot.parsers import Stream, Lattice
from camelot.ext.ghostscript import Ghostscript
from camelot.parsers import Lattice, Stream

from . import configuration as conf
from .models import File, Job, Rule
from .models import Job, File, Rule
from .settings import Session
from .utils.file import mkdirs
from .utils.task import get_file_dim, get_image_dim, get_pages, save_page
from .utils.task import get_pages, save_page, get_file_dim, get_image_dim


def split(file_id):
Expand Down
2 changes: 1 addition & 1 deletion excalibur/utils/metadata.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import uuid
import random
import string
import uuid


def generate_uuid():
Expand Down
2 changes: 1 addition & 1 deletion excalibur/utils/task.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os

import cv2
from camelot.utils import get_page_layout, get_rotation, get_text_objects
from PyPDF2 import PdfFileReader, PdfFileWriter
from camelot.utils import get_rotation, get_page_layout, get_text_objects


def get_pages(filename, pages, password=""):
Expand Down
16 changes: 8 additions & 8 deletions excalibur/www/views.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import datetime as dt
import glob
import json
import os
import re
import glob
import json
import datetime as dt

import pandas as pd
from flask import (
Blueprint,
jsonify,
request,
url_for,
redirect,
render_template,
request,
send_from_directory,
url_for,
)
from werkzeug import secure_filename

from .. import configuration as conf
from ..executors import get_default_executor
from ..models import File, Job, Rule
from ..models import Job, File, Rule
from ..settings import Session
from ..utils.file import allowed_filename, mkdirs
from ..executors import get_default_executor
from ..utils.file import mkdirs, allowed_filename
from ..utils.metadata import generate_uuid, random_string

views = Blueprint("views", __name__)
Expand Down

0 comments on commit 55562e2

Please sign in to comment.