fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import edumed z pad: poprawki
[redakcja.git]
/
apps
/
catalogue
/
management
/
edumed.py
diff --git
a/apps/catalogue/management/edumed.py
b/apps/catalogue/management/edumed.py
index
e5d5ee0
..
ffad2ec
100644
(file)
--- a/
apps/catalogue/management/edumed.py
+++ b/
apps/catalogue/management/edumed.py
@@
-15,14
+15,18
@@
class Tagger:
def line(self, position):
return self.lines[position]
def line(self, position):
return self.lines[position]
- empty_line = re.compile(r"\s+")
+ ignore = [ re.compile(r"^[\[][PA][\]] - [^ ]+$") ]
+ empty_line = re.compile(r"^\s+$")
def skip_empty(self, position):
while self.line(position) == "" or \
def skip_empty(self, position):
while self.line(position) == "" or \
- self.empty_line.match(self.line(position)):
+ self.empty_line.match(self.line(position)) or \
+ filter(lambda r: r.match(self.line(position)),
+ self.ignore[:]):
position += 1
return position
position += 1
return position
+
def tag(self, position):
"""
Return None -- means that we can't tag it in any way
def tag(self, position):
"""
Return None -- means that we can't tag it in any way
@@
-105,7
+109,7
@@
class List(Tagger):
class Paragraph(Tagger):
remove_this = [
class Paragraph(Tagger):
remove_this = [
- re.compile(r"[\s]*opis zawarto
ś
ci[\s]*", re.I),
+ re.compile(r"[\s]*opis zawarto
.
ci[\s]*", re.I),
re.compile(r"^[\s]*$")
]
podrozdzial = [
re.compile(r"^[\s]*$")
]
podrozdzial = [