Further fixes to scripts
This commit is contained in:
1 parent
ef09ef818b
commit
31a6f9b5bf
2 files changed
+21
-19
No files matched your search
+18
-16
@@ -1,10 +1,12 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import sys
|
||||||
|
sys.path.append('isoparser')
|
||||||
|
|
||||||
import errno
|
import errno
|
||||||
import isoparser
|
import isoparser
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
|
||||||
|
|
||||||
ISO_FILE = sys.argv[1]
|
ISO_FILE = sys.argv[1]
|
||||||
OUTPUT_DIR = sys.argv[2]
|
OUTPUT_DIR = sys.argv[2]
|
||||||
@@ -19,25 +21,25 @@ def make_sure_path_exists(path):
|
|||||||
raise
|
raise
|
||||||
|
|
||||||
def extract(node, path):
|
def extract(node, path):
|
||||||
make_sure_path_exists(path)
|
make_sure_path_exists(path)
|
||||||
for entry in node.children:
|
for entry in node.children:
|
||||||
full_path = os.path.join(path, entry.name)
|
full_path = os.path.join(path, entry.name)
|
||||||
|
|
||||||
if entry.is_directory:
|
if entry.is_directory:
|
||||||
extract(entry, full_path)
|
extract(entry, full_path)
|
||||||
else:
|
else:
|
||||||
open(full_path, 'wb').write(entry.content)
|
open(full_path, 'wb').write(entry.content)
|
||||||
|
|
||||||
def decompress_all_files_in(path):
|
def decompress_all_files_in(path):
|
||||||
for item in os.listdir(path):
|
for item in os.listdir(path):
|
||||||
full_path = os.path.join(path, item)
|
full_path = os.path.join(path, item)
|
||||||
|
|
||||||
if os.path.isdir(full_path):
|
if os.path.isdir(full_path):
|
||||||
decompress_all_files_in(full_path)
|
decompress_all_files_in(full_path)
|
||||||
elif full_path.endswith('.Z'):
|
elif full_path.endswith('.Z'):
|
||||||
decompressed_path = full_path[0:len(full_path)-2]
|
decompressed_path = full_path[0:len(full_path)-2]
|
||||||
subprocess.check_call(['./TOSZ', '-ascii', full_path, decompressed_path])
|
subprocess.check_call(['./TOSZ', '-ascii', full_path, decompressed_path])
|
||||||
os.remove(full_path)
|
os.remove(full_path)
|
||||||
|
|
||||||
# Extract TempleOS disk tree
|
# Extract TempleOS disk tree
|
||||||
extract(iso.root, OUTPUT_DIR)
|
extract(iso.root, OUTPUT_DIR)
|
||||||
|
|||||||
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
diff --git a/isoparser/record.py b/isoparser/record.py
|
diff --git a/isoparser/isoparser/record.py b/isoparser/isoparser/record.py
|
||||||
index 4cf19f3..a09160d 100644
|
index 4cf19f3..a09160d 100644
|
||||||
--- a/isoparser/record.py
|
--- a/isoparser/isoparser/record.py
|
||||||
+++ b/isoparser/record.py
|
+++ b/isoparser/isoparser/record.py
|
||||||
@@ -47,7 +47,7 @@ class Record(object):
|
@@ -47,7 +47,7 @@ class Record(object):
|
||||||
|
|
||||||
self.embedded_susp_entries = susp_entries
|
self.embedded_susp_entries = susp_entries
|
||||||
|
|||||||
Reference in new issue
Block a user