git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
servicemp3.cpp: more simple/flexible streaming detection
[enigma2.git]
/
lib
/
python
/
Tools
/
Profile.py
diff --git
a/lib/python/Tools/Profile.py
b/lib/python/Tools/Profile.py
index 7e61da0f2abc66c776c6e34ca205ca378a452691..4d8dd9012841311f2ef3e64a8137e6fcbe69af77 100644
(file)
--- a/
lib/python/Tools/Profile.py
+++ b/
lib/python/Tools/Profile.py
@@
-1,6
+1,6
@@
# the implementation here is a bit crappy.
import time
# the implementation here is a bit crappy.
import time
-from Directories import resolveFilename, SCOPE_
SYSETC
+from Directories import resolveFilename, SCOPE_
CONFIG
PERCENTAGE_START = 50
PERCENTAGE_END = 100
PERCENTAGE_START = 50
PERCENTAGE_END = 100
@@
-9,9
+9,10
@@
profile_start = time.time()
profile_data = {}
total_time = 1
profile_data = {}
total_time = 1
+profile_file = None
try:
try:
- profile_old = open(resolveFilename(SCOPE_
SYSETC
, "profile"), "r").readlines()
+ profile_old = open(resolveFilename(SCOPE_
CONFIG
, "profile"), "r").readlines()
t = None
for line in profile_old:
t = None
for line in profile_old:
@@
-22,7
+23,10
@@
try:
except:
print "no profile data available"
except:
print "no profile data available"
-profile_file = open(resolveFilename(SCOPE_SYSETC, "profile"), "w")
+try:
+ profile_file = open(resolveFilename(SCOPE_CONFIG, "profile"), "w")
+except IOError:
+ print "WARNING: couldn't open profile file!"
def profile(id):
now = time.time() - profile_start
def profile(id):
now = time.time() - profile_start