Skip to content
Snippets Groups Projects
Commit 16889bc6 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

port compare-structures action

parent 84430c06
No related branches found
No related tags found
No related merge requests found
......@@ -513,7 +513,7 @@ def _RevertChainNames(ent):
used_names[original_name] += 1
for chain in ent.chains:
editor.RenameChain(chain, reverted_chains[chain.name[:-len(suffix)]])
rev_out = ["%s -> %s" % (on, nn) for on, nn in reverted_chains.items()]
rev_out = ["%s -> %s" % (on, nn) for on, nn in list(reverted_chains.items())]
ost.LogInfo("Reverted chains: %s" % ", ".join(rev_out))
......@@ -989,9 +989,20 @@ def _Main():
with open(opts.output, "w") as outfile:
json.dump(result, outfile, indent=4, sort_keys=True)
class _Unbuffered(object):
# https://stackoverflow.com/questions/45263064/how-can-i-fix-this-valueerror-cant-have-unbuffered-text-i-o-in-python-3/45263101
def __init__(self, stream):
self.stream = stream
def write(self, data):
self.stream.write(data)
self.stream.flush()
def writelines(self, datas):
self.stream.writelines(datas)
self.stream.flush()
def __getattr__(self, attr):
return getattr(self.stream, attr)
if __name__ == '__main__':
# make script 'hot'
unbuffered = os.fdopen(sys.stdout.fileno(), 'w', 0)
sys.stdout = unbuffered
sys.stdout = _Unbuffered(sys.stdout)
_Main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment