flake8 cleanups, ununsed imports and variables cleanup, changed register_diagnostics to use reverse_lazy instead of reverse
This commit is contained in:
@@ -2,7 +2,6 @@ from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.translation import ugettext
|
||||
from django.db.utils import DatabaseError
|
||||
from django.db.models.signals import post_save
|
||||
from django.core.urlresolvers import reverse
|
||||
|
||||
from navigation.api import register_links, register_menu, register_multi_item_links
|
||||
from permissions.api import register_permissions
|
||||
@@ -11,7 +10,6 @@ from main.api import register_tool
|
||||
|
||||
from ocr.conf.settings import AUTOMATIC_OCR
|
||||
from ocr.models import DocumentQueue
|
||||
from ocr.urls import urlpatterns
|
||||
|
||||
#Permissions
|
||||
PERMISSION_OCR_DOCUMENT = 'ocr_document'
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ def ocr_cleanup(text):
|
||||
Cleanup the OCR's output passing it thru the selected language's
|
||||
cleanup filter
|
||||
"""
|
||||
|
||||
|
||||
output = []
|
||||
for line in text.splitlines():
|
||||
line = line.strip()
|
||||
|
||||
+3
-2
@@ -17,9 +17,10 @@ from ocr.conf.settings import NODE_CONCURRENT_EXECUTION
|
||||
from ocr.conf.settings import REPLICATION_DELAY
|
||||
from ocr.conf.settings import QUEUE_PROCESSING_INTERVAL
|
||||
|
||||
LOCK_EXPIRE = 60 * 5 # Lock expires in 5 minutes
|
||||
LOCK_EXPIRE = 60 * 5 # Lock expires in 5 minutes
|
||||
local_cache = CacheClass([], {})
|
||||
|
||||
|
||||
@task
|
||||
def task_process_queue_document(queue_document_id):
|
||||
queue_document = QueueDocument.objects.get(id=queue_document_id)
|
||||
@@ -40,7 +41,7 @@ def reset_orphans():
|
||||
i = inspect().active()
|
||||
active_tasks = []
|
||||
orphans = []
|
||||
|
||||
|
||||
if i:
|
||||
for host, instances in i.items():
|
||||
for instance in instances:
|
||||
|
||||
+1
-1
@@ -274,7 +274,7 @@ def all_document_ocr_cleanup(request):
|
||||
def display_link(obj):
|
||||
output = []
|
||||
if hasattr(obj, 'get_absolute_url'):
|
||||
output.append(u'<a href="%(url)s">%(obj)s</a>'% {
|
||||
output.append(u'<a href="%(url)s">%(obj)s</a>' % {
|
||||
'url': obj.get_absolute_url(),
|
||||
'obj': obj
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user