@@ -88,16 +88,20 @@ class SessionFileHandler(StreamHandler):
|
|||||||
|
|
||||||
# If uncompressed, compress
|
# If uncompressed, compress
|
||||||
if not path.name.endswith(".xz"):
|
if not path.name.endswith(".xz"):
|
||||||
new_path = path.with_suffix(path.suffix + ".xz")
|
compressed_path = path.with_suffix(path.suffix + ".xz")
|
||||||
with (
|
with (
|
||||||
lzma.open(
|
lzma.open(
|
||||||
new_path, "wt", format=FORMAT_XZ, preset=PRESET_DEFAULT
|
compressed_path,
|
||||||
|
"wt",
|
||||||
|
format=FORMAT_XZ,
|
||||||
|
preset=PRESET_DEFAULT,
|
||||||
|
encoding="utf-8",
|
||||||
) as lzma_file,
|
) as lzma_file,
|
||||||
open(path, "r", encoding="utf-8") as original_file,
|
open(path, "r", encoding="utf-8") as original_file,
|
||||||
):
|
):
|
||||||
lzma_file.write(original_file.read())
|
lzma_file.write(original_file.read())
|
||||||
path.unlink()
|
path.unlink()
|
||||||
path = new_path
|
path = compressed_path
|
||||||
|
|
||||||
# Rename with new number suffix
|
# Rename with new number suffix
|
||||||
new_number = self.get_path_number(path) + 1
|
new_number = self.get_path_number(path) + 1
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ class PreferencesWindow(Adw.PreferencesWindow):
|
|||||||
source = source_class()
|
source = source_class()
|
||||||
if not source.is_available:
|
if not source.is_available:
|
||||||
expander_row = getattr(self, f"{source.id}_expander_row")
|
expander_row = getattr(self, f"{source.id}_expander_row")
|
||||||
expander_row.remove()
|
expander_row.set_visible(False)
|
||||||
else:
|
else:
|
||||||
self.init_source_row(source)
|
self.init_source_row(source)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user