summaryrefslogtreecommitdiffstats
path: root/tools/scripts/memsort.py
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-01-02 19:12:25 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-01-02 19:12:25 -0300
commitce26eb74bca48f16e9a34b4eb1c34e50dfc5daae (patch)
tree5f9c387037d0142d40f7275575436483dc0a7237 /tools/scripts/memsort.py
parentab4126f51061277e87b41c48b40e7b54942d4eca (diff)
parent45c5c89de961357a7042d9e1f063e288d7a510cf (diff)
downloadredot-engine-ce26eb74bca48f16e9a34b4eb1c34e50dfc5daae.tar.gz
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'tools/scripts/memsort.py')
-rw-r--r--tools/scripts/memsort.py36
1 files changed, 18 insertions, 18 deletions
diff --git a/tools/scripts/memsort.py b/tools/scripts/memsort.py
index d2e4fe0226..fb636b0f78 100644
--- a/tools/scripts/memsort.py
+++ b/tools/scripts/memsort.py
@@ -1,35 +1,35 @@
import sys
-arg="memdump.txt"
+arg = "memdump.txt"
-if (len(sys.argv)>1):
- arg=sys.argv[1]
+if (len(sys.argv) > 1):
+ arg = sys.argv[1]
-f = open(arg,"rb")
+f = open(arg, "rb")
-l=f.readline()
+l = f.readline()
sum = {}
-cnt={}
+cnt = {}
-while(l!=""):
+while(l != ""):
- s=l.split("-")
- amount = int(s[1])
- what=s[2]
- if (what in sum):
- sum[what]+=amount
- cnt[what]+=1
- else:
- sum[what]=amount
- cnt[what]=1
+ s = l.split("-")
+ amount = int(s[1])
+ what = s[2]
+ if (what in sum):
+ sum[what] += amount
+ cnt[what] += 1
+ else:
+ sum[what] = amount
+ cnt[what] = 1
- l=f.readline()
+ l = f.readline()
for x in sum:
- print(x.strip()+"("+str(cnt[x])+"):\n: "+str(sum[x]))
+ print(x.strip() + "(" + str(cnt[x]) + "):\n: " + str(sum[x]))