service.py 832 B

123456789101112131415161718192021222324252627282930
  1. # -*- coding: utf-8 -*-
  2. serviceType = "local"
  3. serviceDesc = _({"en": "Console Mouse Daemon",
  4. "tr": "Konsol Fare Servisi"})
  5. from comar.service import *
  6. @synchronized
  7. def start():
  8. args = []
  9. args.append("-m %s" % config.get("MOUSEDEV", "/dev/input/mice"))
  10. args.append("-t %s" % config.get("MOUSE", "imps2"))
  11. if "RESPONSIVENESS" in config:
  12. args.append("-r %s " % config.get("RESPONSIVENESS"))
  13. if "REPEAT_TYPE" in config:
  14. args.append("-R%s " % config.get("REPEAT_TYPE"))
  15. args.append(config.get("APPEND", ""))
  16. startService(command="/usr/bin/gpm",
  17. args=" ".join(args),
  18. donotify=True)
  19. @synchronized
  20. def stop():
  21. stopService(pidfile="/run/gpm.pid",
  22. donotify=True)
  23. def status():
  24. return isServiceRunning("/run/gpm.pid")