Merge branch 'master' of ssh://holtrop.homelinux.com/files

This commit is contained in:
Josh Holtrop 2011-10-24 22:54:40 -04:00
commit 3c8c7f2eec

10
hours
View File

@ -45,10 +45,7 @@ def get_adjustments():
if not os.path.isfile(ADJUSTMENTS_FILE):
return adjustments
f = open(ADJUSTMENTS_FILE, 'r')
while True:
line = f.readline()
if line == '':
break
for line in iter(f.readline, ''):
m = re.match(r'adj\s+(\S+)\s+(\S+)', line)
if m is not None:
adjustments[m.group(1)] = float(m.group(2))
@ -113,10 +110,7 @@ def main(argv):
times.append([None, None])
f = open(LOG_FILE, 'r')
while True:
line = f.readline()
if line == '':
break
for line in iter(f.readline, ''):
if (re.search(r'gnome-screensaver.*unlocked.login.keyring', line)
or re.search(r'screen unlocked', line)):
# found a login line