#!/usr/bin/python import sys import math if (len(sys.argv)<2): print('''Anduril network file indentation tool: give the filename to break... ''') sys.exit() f=open(sys.argv[1],'r') orig=f.read() size=len(orig) f.close() chrcount=0 brace=0 firstofrow=True inquotes=False space=' ' for i in range(size): c=orig[i] chrcount+=1 if c=="\t": sys.stdout.write(" ") else: sys.stdout.write(c) if c=='"': inquotes = not inquotes if ( not inquotes ): if c=="\n": chrcount=0 brace=0 firstofrow=True if ( c=="(" ) & ( firstofrow ): brace=int(min(32,math.ceil((chrcount)/4)*4)) firstofrow=False if ( i+1