mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-16 11:36:39 +01:00
Clean up some linter complaints
This commit is contained in:
parent
39ef81d398
commit
cccc9e1a24
1 changed files with 4 additions and 6 deletions
|
|
@ -1,7 +1,5 @@
|
||||||
import datetime
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
@ -13,7 +11,7 @@ from ...mail import MailFetcher, MailFetcherError
|
||||||
try:
|
try:
|
||||||
from inotify_simple import INotify, flags
|
from inotify_simple import INotify, flags
|
||||||
except ImportError:
|
except ImportError:
|
||||||
pass
|
INotify = flags = None
|
||||||
|
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
|
|
@ -62,7 +60,8 @@ class Command(BaseCommand):
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--no-inotify",
|
"--no-inotify",
|
||||||
action="store_true",
|
action="store_true",
|
||||||
help="Don't use inotify, even if it's available."
|
help="Don't use inotify, even if it's available.",
|
||||||
|
default=False
|
||||||
)
|
)
|
||||||
|
|
||||||
def handle(self, *args, **options):
|
def handle(self, *args, **options):
|
||||||
|
|
@ -71,8 +70,7 @@ class Command(BaseCommand):
|
||||||
directory = options["directory"]
|
directory = options["directory"]
|
||||||
loop_time = options["loop_time"]
|
loop_time = options["loop_time"]
|
||||||
mail_delta = options["mail_delta"] * 60
|
mail_delta = options["mail_delta"] * 60
|
||||||
use_inotify = (not options["no_inotify"]
|
use_inotify = INotify is not None and options["no_inotify"] is False
|
||||||
and "inotify_simple" in sys.modules)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.file_consumer = Consumer(consume=directory)
|
self.file_consumer = Consumer(consume=directory)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue