Skip to content

Commit e14efd8

Browse files
committed
Add last directory of file to the verbose output.
1 parent dd0c799 commit e14efd8

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

regionfixer_core/scan.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import sys
2626
import logging
2727
import multiprocessing
28-
from os.path import split, abspath
28+
from os.path import split, abspath, join
2929
from time import sleep, time
3030
from copy import copy
3131
from traceback import extract_tb
@@ -623,7 +623,8 @@ def console_scan_loop(scanners, scan_titles, verbose):
623623
else:
624624
status = "(" + result.oneliner_status + ")"
625625
fn = result.filename
626-
print("Scanned {0: <12} {1:.<43} {2}/{3}".format(fn, status, counter, total))
626+
fol = result.folder
627+
print("Scanned {0: <12} {1:.<43} {2}/{3}".format(join(fol, fn), status, counter, total))
627628
if not verbose:
628629
pbar.finish()
629630
except KeyboardInterrupt as e:

regionfixer_core/world.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ def __init__(self, path=None):
5353
self.path = path
5454
if self.path and exists(self.path):
5555
self.filename = split(path)[1]
56+
self.folder = split(split(path)[0])[1]
5657
else:
5758
self.filename = None
5859
# The status of the region file.
@@ -92,7 +93,7 @@ def __init__(self, path, scanned_time=None):
9293
# general region file info
9394
self.path = path
9495
self.filename = split(path)[1]
95-
self.folder = split(path)[0]
96+
self.folder = split(split(path)[0])[1]
9697
self.x = self.z = None
9798
self.x, self.z = self.get_coords()
9899
self.coords = (self.x, self.z)
@@ -393,19 +394,19 @@ def fix_problematic_chunks(self, status):
393394
if len(cdata) == len(raw_chunk):
394395
# the chunk is probably good, write it in the region file
395396
region_file.write_blockdata(local_coords[0], local_coords[1], out)
396-
print("The chunk {0},{1} in region file {2} was fixed successfully.".format(local_coords[0], local_coords[1], self.filename))
397+
print("The chunk {0},{1} in region file {2} was fixed successfully.".format(local_coords[0], local_coords[1], join(self.folder,self.filename)))
397398
else:
398-
print("The chunk {0},{1} in region file {2} couldn't be fixed.".format(local_coords[0], local_coords[1], self.filename))
399+
print("The chunk {0},{1} in region file {2} couldn't be fixed.".format(local_coords[0], local_coords[1], join(self.folder,self.filename)))
399400
#=======================================================
400401
# print("Extracted: " + str(len(out)))
401402
# print("Size of the compressed stream: " + str(len(raw_chunk)))
402403
#=======================================================
403404
except region.ChunkHeaderError:
404405
# usually a chunk with zero length, pass
405-
print("The chunk {0},{1} in region file {2} couldn't be fixed.".format(local_coords[0], local_coords[1], self.filename))
406+
print("The chunk {0},{1} in region file {2} couldn't be fixed.".format(local_coords[0], local_coords[1], join(self.folder,self.filename)))
406407
except region.RegionHeaderError:
407408
# usually a chunk with zero length, pass
408-
print("The chunk {0},{1} in region file {2} couldn't be fixed.".format(local_coords[0], local_coords[1], self.filename))
409+
print("The chunk {0},{1} in region file {2} couldn't be fixed.".format(local_coords[0], local_coords[1], join(self.folder,self.filename)))
409410

410411
if status == c.CHUNK_MISSING_ENTITIES_TAG:
411412
# The arguments to create the empty TAG_List have been somehow extracted by comparing

0 commit comments

Comments
 (0)