]> git.phdru.name Git - bookmarks_db.git/commitdiff
Fix(Py3): Stop using module `string`
authorOleg Broytman <phd@phdru.name>
Sat, 11 Nov 2023 18:34:51 +0000 (21:34 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 12 Nov 2023 19:21:09 +0000 (22:21 +0300)
Storage/bkmk_stflad.py

index 7f417b0b778aa953c8de1b8530b47b1edc7abe71..a4634fa8bc9a29617bb63358622baaaed6c3783d 100644 (file)
@@ -12,7 +12,6 @@ __license__ = "GNU GPL"
 __all__ = ['storage_flad']
 
 
-import string
 from m_lib.flad import fladm
 from bkmk_objects import Folder, Bookmark, Ruler, Walker
 
@@ -24,8 +23,8 @@ class storage_flad(Walker):
         self.first_object = 1
 
     def root_folder(self, f):
-        header = string.replace(f.header, ".", ".\n")
-        header = string.replace(header, "<", "\n<", 3)[1:]
+        header = f.header.replace(".", ".\n")
+        header = header.replace("<", "\n<", 3)[1:]
         header_file = open("header", 'w')
         header_file.write(header + "\n")
         header_file.write('<H1>%s</H1>\n\n' % f.name)
@@ -88,10 +87,10 @@ Charset: %s
         header = header_file.read()
         header_file.close()
 
-        header = string.split(header, "\n")
-        root_folder.header = string.join(header[:5], '')
+        header = header.split("\n")
+        root_folder.header = header[:5].join('')
         root_folder.name = header[5][4:-5]
-        root_folder.comment = string.join(header[7:], '')[4:]
+        root_folder.comment = header[7:].join('')[4:]
 
         save_level = 0
         got_folder = 1  # Start as if we already have one folder