Files
main/hardware/irda/lirc/comar/service.py
T
Poyraz76 494c35ea46 lirc
2015-08-20 17:05:30 +03:00

35 lines
962 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# -*- coding: utf-8 -*-
from comar.service import *
serviceType = "local"
serviceDefault = "off"
serviceDesc = _({"en": "InfraRed Controller Manager",
"tr": "Kızılötesi Denetleyici Yöneticisi"})
lircdpid = "/var/run/lirc/lircd.pid"
@synchronized
def start():
lircmodule = config.get("LIRC_MODULE", "")
if lircmodule != "":
run("modprobe %s" % lircmodule)
reply = startService(command="/usr/sbin/lircd",
args=config.get("LIRCD_OPTS", ""),
pidfile=lircdpid,
donotify=True)
if reply == 0 and config.get("USE_LIRCMD", "no") == "yes":
startService(command="/usr/sbin/lircmd")
@synchronized
def stop():
reply = stopService(pidfile=lircdpid,
donotify=True)
if config.get("USE_LIRCMD", "no") == "yes":
stopService(command="/usr/sbin/lircmd")
def status():
return isServiceRunning(lircdpid)