1 # the implementation here is a bit crappy.
3 from Directories import resolveFilename, SCOPE_CONFIG
8 profile_start = time.time()
15 profile_old = open(resolveFilename(SCOPE_CONFIG, "profile"), "r").readlines()
18 for line in profile_old:
19 (t, id) = line[:-1].split('\t')
24 print "no profile data available"
27 profile_file = open(resolveFilename(SCOPE_CONFIG, "profile"), "w")
29 print "WARNING: couldn't open profile file!"
32 now = time.time() - profile_start
34 profile_file.write("%.2f\t%s\n" % (now, id))
36 if id in profile_data:
38 perc = t * (PERCENTAGE_END - PERCENTAGE_START) / total_time + PERCENTAGE_START
40 open("/proc/progress", "w").write("%d \n" % perc)
46 if profile_file is not None: