X-Git-Url: https://git.phdru.name/?p=m_lib.git;a=blobdiff_plain;f=m_lib%2Fflad%2Ffladw.py;h=fa0007443d7060a54257a416ab60d2d6160f11b5;hp=ccbd5d53ed4202f1e985b9c30417ad4f9ba16964;hb=4dedeb2041f8b9f7796991c2ff513f9e3aa8b386;hpb=c8455bf373d58d8b2928ba3d56488318f4095b83 diff --git a/m_lib/flad/fladw.py b/m_lib/flad/fladw.py index ccbd5d5..fa00074 100644 --- a/m_lib/flad/fladw.py +++ b/m_lib/flad/fladw.py @@ -3,7 +3,7 @@ """ -import string, re +import re from m_lib.flad import flad @@ -33,10 +33,10 @@ class Flad_WIni(flad.Flad): return match.group(1) # Signal to stop filling the record (section) and start a new one if self.first_section: - if string.strip(line) != '': + if line.strip() != '': raise error("non-empty line before 1st section") - elif (string.strip(line) == '') or (string.lstrip(line)[0] == ';') : # Empty line or comment + elif (line.strip() == '') or (line.lstrip()[0] == ';') : # Empty line or comment record[0].append(line) else: @@ -72,7 +72,7 @@ class Flad_WIni(flad.Flad): self.section = section else: - if self.first_section and (string.strip(line) != ''): + if self.first_section and (line.strip() != ''): raise error("non-empty line before 1st section") # else: line had been appended to section in __parse_line() @@ -85,7 +85,7 @@ class Flad_WIni(flad.Flad): klist = record[1] if klist: l = len(klist) - 1 - if string.strip(klist[l]) == '': + if klist[l].strip() == '': del klist[l] return 0 @@ -110,7 +110,7 @@ class Flad_WIni(flad.Flad): if record[1]: for key in record[1]: - if string.strip(key) == '' or string.lstrip(key)[0] == ';' : + if key.strip() == '' or key.lstrip()[0] == ';' : outfile.write(key) else: outfile.write(key + self.key_sep + record[2][key] + '\n')