WIP: python3

This commit is contained in:
htouvet
2020-07-24 12:14:48 +02:00
parent 8aa63dbdd4
commit 1a99f9bb9a
11 changed files with 185 additions and 172 deletions
Executable → Regular
+5 -4
View File
@@ -1,5 +1,6 @@
import compat
from ini import LineContainer, EmptyLine
from . import compat
from .ini import LineContainer, EmptyLine
def tidy(cfg):
"""Clean up blank lines.
@@ -32,12 +33,12 @@ def tidy(cfg):
if cont and not isinstance(cont[-1], EmptyLine):
cont.append(EmptyLine())
def tidy_section(lc):
cont = lc.contents
i = 1
while i < len(cont):
if (isinstance(cont[i-1], EmptyLine) and
isinstance(cont[i], EmptyLine)):
if isinstance(cont[i-1], EmptyLine) and isinstance(cont[i], EmptyLine):
del cont[i]
else:
i += 1