diff options
author | James Meyer <james.meyer@operamail.com> | 2013-06-04 19:51:22 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2013-06-04 19:51:22 (GMT) |
commit | c9041c8753b14ad9616c8dc3deb0e0426d94fd5f (patch) | |
tree | 25319188c6c64cbf5bc1b5eefb8d63b7635676e3 /abs/core/LinHES-config/mv_ir.py | |
parent | a1b54c58e054ad7adf1c4b609dc978f558dad3af (diff) | |
download | linhes_pkgbuild-c9041c8753b14ad9616c8dc3deb0e0426d94fd5f.zip linhes_pkgbuild-c9041c8753b14ad9616c8dc3deb0e0426d94fd5f.tar.gz linhes_pkgbuild-c9041c8753b14ad9616c8dc3deb0e0426d94fd5f.tar.bz2 |
LinHES-config: mv_ir.py add support for custom xbmc lirc mapping. If a remote definition has a xbmc.xml file it will be symlinked for xbmc usage.
refs #910
Diffstat (limited to 'abs/core/LinHES-config/mv_ir.py')
-rwxr-xr-x | abs/core/LinHES-config/mv_ir.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/abs/core/LinHES-config/mv_ir.py b/abs/core/LinHES-config/mv_ir.py index d77f64f..f481fa4 100755 --- a/abs/core/LinHES-config/mv_ir.py +++ b/abs/core/LinHES-config/mv_ir.py @@ -136,6 +136,48 @@ def setup_ir_remote(Remotetype,templates,mythhome,HostBlasterType,remotebucket): cmd = "cp %s /etc/remote.run" %filename mv_common.runcmd(cmd) + #if remote has a special xbmc file, use it. + xbmcfile= remote_path + "/xbmc.xml" + userxmbcfile = mythhome+"/.xbmc/userdata/Lircmap.xml" + + if os.path.exists(xbmcfile): + logging.debug(" XBMC lirc file present") + logging.info(" Setting up lirc for xbmc") + if not os.path.exists(mythhome+"/.xbmc/userdata"): + logging.debug(" Creating %s/.xbmc",mythhome) + try: + os.mkdir(mythhome+"/.xbmc") + except: + logging.debug(" Couldn't create .xbmc/ ") + try: + os.mkdir(mythhome+"/.xbmc/userdata/") + except: + logging.debug(" Couldn't create .xbmc/userdata ") + + try: + cmd = ''' chown -R mythtv %s/.xbmc''' %mythhome + mv_common.runcmd(cmd) + cmd = ''' chgrp -R mythtv %s/.xbmc/userdata''' %mythhome + mv_common.runcmd(cmd) + except: + logging.debug(" Couldn't change permissions for .xbmc") + pass + try: + cmd = ''' rm -f %s''' %(userxmbcfile) + mv_common.runcmd(cmd) + logging.debug(" Creating symlink for xmbc lircrc") + os.symlink(xbmcfile, mythhome+"/.xbmc/userdata/Lircmap.xml") + except: + pass + else: + logging.debug(" XBMC lirc file %s not present" %xbmcfile) + + + + + + + #remote has it's own modprobe.d/conf filename cmd = "rm -f /etc/modprobe.d/mv_ir.conf" mv_common.runcmd(cmd) |