Skip to content

Commit

Permalink
skip comments in lircd.conf
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew McCready committed Feb 20, 2015
1 parent d1519e2 commit cb700cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lirc/lirc.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from subprocess import call

import re

class Lirc:
"""
Expand Down Expand Up @@ -33,6 +33,10 @@ def parse(self):
for line in self.conf:
# Convert tabs to spaces
l = line.replace('\t',' ')

# Skip comments
if re.match('^\s*#',line):
continue

# Look for a 'begin remote' line
if l.strip()=='begin remote':
Expand Down Expand Up @@ -72,4 +76,4 @@ def send_once(self, device_id, message):
if __name__ == "__main__":
lirc = Lirc('/etc/lirc/lircd.conf')



0 comments on commit cb700cf

Please sign in to comment.