1 # the implementation here is a bit crappy.
3 from Directories import resolveFilename, SCOPE_CONFIG
8 profile_start = time.time()
14 profile_old = open(resolveFilename(SCOPE_CONFIG, "profile"), "r").readlines()
17 for line in profile_old:
18 (t, id) = line[:-1].split('\t')
23 print "no profile data available"
25 profile_file = open(resolveFilename(SCOPE_CONFIG, "profile"), "w")
28 now = time.time() - profile_start
30 profile_file.write("%.2f\t%s\n" % (now, id))
32 if id in profile_data:
34 perc = t * (PERCENTAGE_END - PERCENTAGE_START) / total_time + PERCENTAGE_START
36 open("/proc/progress", "w").write("%d \n" % perc)
42 if profile_file is not None: