fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix conversion wl2 to wl1
[redakcja.git]
/
apps
/
catalogue
/
models
/
book.py
diff --git
a/apps/catalogue/models/book.py
b/apps/catalogue/models/book.py
index
b5a3bf3
..
b0862f0
100755
(executable)
--- a/
apps/catalogue/models/book.py
+++ b/
apps/catalogue/models/book.py
@@
-430,6
+430,7
@@
class Book(models.Model):
import os.path
from django.conf import settings
from fnpdjango.utils.text.slughifi import slughifi
import os.path
from django.conf import settings
from fnpdjango.utils.text.slughifi import slughifi
+ from librarian import ParseError
def _register_function(f):
""" Register extension function with lxml """
def _register_function(f):
""" Register extension function with lxml """
@@
-462,7
+463,7
@@
class Book(models.Model):
i1 = etree.parse(f2)
for sect in i1.findall('//section'):
i1 = etree.parse(f2)
for sect in i1.findall('//section'):
- if sect[0].text == u'Przebieg zajęć':
+ if sect[0].text
and sect[0].text.strip()
== u'Przebieg zajęć':
# Prostujemy.
first = sect.find('section')
subs = first.findall('.//section')
# Prostujemy.
first = sect.find('section')
subs = first.findall('.//section')
@@
-471,7
+472,7
@@
class Book(models.Model):
break
else:
# print 'BRAK PRZEBIEGU'
break
else:
# print 'BRAK PRZEBIEGU'
- raise
Valu
eError('Brak przebiegu')
+ raise
Pars
eError('Brak przebiegu')
i1.getroot().attrib['redslug'] = self.slug
i1.getroot().attrib['wlslug'] = self.slug # THIS!
i1.getroot().attrib['redslug'] = self.slug
i1.getroot().attrib['wlslug'] = self.slug # THIS!
@@
-479,6
+480,6
@@
class Book(models.Model):
w1t = i1.xslt(t)
for h in w1t.findall('//aktywnosc/opis'):
if not re.match(r'\d\.\s', h[0].text):
w1t = i1.xslt(t)
for h in w1t.findall('//aktywnosc/opis'):
if not re.match(r'\d\.\s', h[0].text):
- raise
Assertion
Error('Niepoprawny nagłówek (aktywnosc/opis): %s' % repr(h[0].text))
+ raise
Parse
Error('Niepoprawny nagłówek (aktywnosc/opis): %s' % repr(h[0].text))
h[0].text = h[0].text[3:]
return etree.tostring(w1t, encoding='utf-8')
h[0].text = h[0].text[3:]
return etree.tostring(w1t, encoding='utf-8')