fnp
/
wolnelektury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixes #4076: Recommendations from collections.
[wolnelektury.git]
/
src
/
search
/
management
/
commands
/
snippets.py
diff --git
a/src/search/management/commands/snippets.py
b/src/search/management/commands/snippets.py
old mode 100755
(executable)
new mode 100644
(file)
index
af80143
..
62512c9
--- a/
src/search/management/commands/snippets.py
+++ b/
src/search/management/commands/snippets.py
@@
-1,26
+1,23
@@
-# -*- coding: utf-8 -*-
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
-from django.core.management.base import BaseCommand
-
from glob import glob
from os import path
from django.conf import settings
from glob import glob
from os import path
from django.conf import settings
+from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = 'Check snippets.'
class Command(BaseCommand):
help = 'Check snippets.'
- args = ''
def handle(self, *args, **opts):
sfn = glob(settings.SEARCH_INDEX+'snippets/*')
for fn in sfn:
def handle(self, *args, **opts):
sfn = glob(settings.SEARCH_INDEX+'snippets/*')
for fn in sfn:
- print
fn
+ print
(fn)
bkid = path.basename(fn)
with open(fn) as f:
cont = f.read()
try:
cont.decode('utf-8')
except UnicodeDecodeError:
bkid = path.basename(fn)
with open(fn) as f:
cont = f.read()
try:
cont.decode('utf-8')
except UnicodeDecodeError:
- print
"error in snippets %s" % bkid
+ print
("error in snippets %s" % bkid)