Added tooltip to mix item and toggle state to live button

This commit is contained in:
=
2012-09-27 21:47:47 +01:00
parent 382653d36f
commit a3ec72b6f4
11 changed files with 118 additions and 38 deletions

View File

@@ -11,4 +11,31 @@ def rreplace(string, pattern, sub):
"""
Replaces 'pattern' in 'string' with 'sub' if 'pattern' ends 'string'.
"""
return re.sub('%s$' % pattern, sub, string)
return re.sub('%s$' % pattern, sub, string)
def is_number(s):
try:
if len(s) > 0:
float(s)
return True
except ValueError:
pass
except IndexError:
pass
except Exception:
pass
return False
def trunc_lines(s, linecount):
ret = ""
cur = 0
for line in s.splitlines():
if cur < linecount:
ret += line + "\n"
cur += 1
else:
break
return ret