aboutsummaryrefslogtreecommitdiffstats
path: root/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-02-20 17:21:42 +0100
committerSoispha <soispha@vhack.eu>2024-02-20 17:21:42 +0100
commitf2bdeaed0bcf97a880fe36cfc8a050d1643120b8 (patch)
treeba4fe9c3ddf076529701c0e776ffef2104ac23d5 /hm/soispha/conf/firefox/scripts/unzip_mozlz4.py
parentrefactor(treewide): Add a `.sh` extension to shell scripts (diff)
downloadnixos-config-f2bdeaed0bcf97a880fe36cfc8a050d1643120b8.zip
refactor(treewide): Reformat all files with treefmt
This includes getting all shellscripts to pass shellcheck. To accomplish this, some old scripts were removed
Diffstat (limited to 'hm/soispha/conf/firefox/scripts/unzip_mozlz4.py')
-rwxr-xr-xhm/soispha/conf/firefox/scripts/unzip_mozlz4.py41
1 files changed, 21 insertions, 20 deletions
diff --git a/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py b/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py
index 90dfdd29..44e00d53 100755
--- a/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py
+++ b/hm/soispha/conf/firefox/scripts/unzip_mozlz4.py
@@ -18,26 +18,27 @@ def mozlz4_to_text(filepath):
def main(args):
- # Given command-line arguments of an input filepath for a ".mozlz4" file
- # and optionally an output filepath, write the decompressed text to the
- # output filepath.
- # Default output filepath is the input filepath minus the last three characters
- # (e.g. "foo.jsonlz4" becomes "foo.json")
- filepath_in = args[0]
- if len(args) < 2:
- filepath_out = filepath_in[:-3]
- else:
- filepath_out = args[1]
- text = mozlz4_to_text(filepath_in)
- with open(filepath_out, "wb") as outfile:
- outfile.write(text)
- print("Wrote decompressed text to {}".format(filepath_out))
+ # Given command-line arguments of an input filepath for a ".mozlz4" file
+ # and optionally an output filepath, write the decompressed text to the
+ # output filepath.
+ # Default output filepath is the input filepath minus the last three characters
+ # (e.g. "foo.jsonlz4" becomes "foo.json")
+ filepath_in = args[0]
+ if len(args) < 2:
+ filepath_out = filepath_in[:-3]
+ else:
+ filepath_out = args[1]
+ text = mozlz4_to_text(filepath_in)
+ with open(filepath_out, "wb") as outfile:
+ outfile.write(text)
+ print("Wrote decompressed text to {}".format(filepath_out))
if __name__ == "__main__":
- import sys
- args = sys.argv[1:]
- if args and not args[0] in ("--help", "-h"):
- main(args)
- else:
- print("Usage: mozlz4.py <mozlz4 file to read> <location to write>")
+ import sys
+
+ args = sys.argv[1:]
+ if args and not args[0] in ("--help", "-h"):
+ main(args)
+ else:
+ print("Usage: mozlz4.py <mozlz4 file to read> <location to write>")