Skip to content

Commit

Permalink
patch maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
staffanm committed Nov 16, 2017
1 parent 34d8c1f commit a39f7dd
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 33 deletions.
2 changes: 1 addition & 1 deletion ferenda/devel.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def format_exception():
pfp = StringIO(codecs.decode(pfp.read(), "rot13"))
try:
ps = PatchSet.from_stream(pfp)
lines = text.split("\n"))
lines = text.split("\n")
offsets = ps.patches[0].adjust(lines)
text = "\n".join(ps.patches[0].merge(lines))
if ps.patches[0].hunks[0].comment:
Expand Down
5 changes: 3 additions & 2 deletions ferenda/pdfreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,9 @@ def txt(element_text):
continue
assert element.tag == 'text', "Got <%s>, expected <text>" % element.tag
# eliminate "empty" textboxes, including "<text><i> </i></text>\n"
if element.text and txt(
element.text).strip() == "" and not element.getchildren():
if (((element.text and txt(element.text).strip() == "") or
(element.text is None)) and
not element.getchildren()):
# print "Skipping empty box"
continue
if len(page) > 0:
Expand Down
2 changes: 1 addition & 1 deletion ferenda/sources/legal/se/swedishlegalsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ def patch_if_needed(self, fp, basefile):

# perform the patching, return the result as a stream, and add
# an attribute with the description
lines = [l.rstrip() for l in fp.readlines()]
lines = [l.rstrip("\n") for l in fp.readlines()]
offsets = ps.patches[0].adjust(lines)
if any(offsets):
self.log.warning("Patch source ranges had to be adjusted: %s" % offsets)
Expand Down
10 changes: 10 additions & 0 deletions lagen/nu/res/patches/sfs/patches/1974/152.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- data/sfs/intermediate/1974/152.txt.bz2
+++
@@ -234,6 +234,7 @@ Formattering av rubrik innan 2 kap 12 §
En rättegång ska genomföras rättvist och inom skälig tid.
Förhandling vid domstol ska vara offentlig. Lag
(2010:1408).
+
Skydd mot diskriminering

12 § Lag eller annan föreskrift får inte innebära att någon
1 change: 0 additions & 1 deletion lagen/nu/res/patches/sfs/patches/1998/1513.desc

This file was deleted.

13 changes: 0 additions & 13 deletions lagen/nu/res/patches/sfs/patches/1998/1513.patch

This file was deleted.

1 change: 0 additions & 1 deletion lagen/nu/res/patches/sfs/patches/2009/62.desc

This file was deleted.

14 changes: 0 additions & 14 deletions lagen/nu/res/patches/sfs/patches/2009/62.patch

This file was deleted.

0 comments on commit a39f7dd

Please sign in to comment.