diff options
author | James Meyer <james.meyer@operamail.com> | 2012-08-21 23:14:45 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-08-21 23:15:02 (GMT) |
commit | 481f24b9a6ce18c0f3ad20a9b20b0a54a18f7d10 (patch) | |
tree | b18d69ce41c0eb8ce1659d422453128e8aea1e75 /abs/core/LinHES-system | |
parent | 8f81b53988c04f276fd8ae595dd6ed101e15003b (diff) | |
download | linhes_pkgbuild-481f24b9a6ce18c0f3ad20a9b20b0a54a18f7d10.zip linhes_pkgbuild-481f24b9a6ce18c0f3ad20a9b20b0a54a18f7d10.tar.gz linhes_pkgbuild-481f24b9a6ce18c0f3ad20a9b20b0a54a18f7d10.tar.bz2 |
LinHES-system: added gen_is_xml.py.
This is used to generate the internet_streams xml file.
gen_is.xml should never be hand edited. Instead edit the files in /etc/gen_is_xml.d
Diffstat (limited to 'abs/core/LinHES-system')
-rwxr-xr-x | abs/core/LinHES-system/PKGBUILD | 9 | ||||
-rwxr-xr-x | abs/core/LinHES-system/gen_is_xml.py | 56 | ||||
-rw-r--r-- | abs/core/LinHES-system/readme_is_xml | 1 |
3 files changed, 63 insertions, 3 deletions
diff --git a/abs/core/LinHES-system/PKGBUILD b/abs/core/LinHES-system/PKGBUILD index 8219d17..d807f78 100755 --- a/abs/core/LinHES-system/PKGBUILD +++ b/abs/core/LinHES-system/PKGBUILD @@ -23,10 +23,10 @@ binfiles="LinHES-start optimize_mythdb.py diskspace.sh cacheclean lh_message.sh switch_web.sh create_media_dirs.sh - msg_client.py msg_daemon.py" + msg_client.py msg_daemon.py gen_is_xml.py" source=(LinHES-session LinHES-profile.sh $binfiles alsa-base myth_mtc.lr - diskspace smolt.cron cacheclean.cron) + diskspace smolt.cron cacheclean.cron readme_is_xml) build() { cd $startdir/src @@ -49,6 +49,7 @@ build() { done install -m644 -D $startdir/src/alsa-base $startdir/pkg/etc/modprobe.d/alsa-base.conf + install -m644 -D $startdir/src/readme_is_xml $startdir/pkg/etc/gen_is_xml.d/readme_is_xml install -m755 -D $startdir/src/smolt.cron $startdir/pkg/etc/cron.weekly/smolt.cron install -m755 -D $startdir/src/cacheclean.cron $startdir/pkg/etc/cron.weekly/cacheclean.cron install -m755 -D $startdir/src/diskspace $startdir/pkg/etc/cron.tenminutes/diskspace @@ -83,8 +84,10 @@ md5sums=('c5bbcfbc2b426158d90e79103a524b7c' '717b80d5069188ccef52001de0df0c21' 'a182af47a7d373b2a63a27e1bb7485b2' '5148fe4c6ac27fff8152c819c4d2b47a' + 'fd21c1b19331581d603d5949c90d5c61' 'eb879fee9603a05d5420d4ce8ed9e450' 'f1870a9522c79e6b248fcbf81dec3280' '84492954db16740f949d795b74383189' 'abe887472a170bd1a8e6da6a7b7e93e4' - '02c810c2f47b7c4495fdacaf54189473') + '02c810c2f47b7c4495fdacaf54189473' + '93a2af3e723f36c063623f705330d337') diff --git a/abs/core/LinHES-system/gen_is_xml.py b/abs/core/LinHES-system/gen_is_xml.py new file mode 100755 index 0000000..c5b988f --- /dev/null +++ b/abs/core/LinHES-system/gen_is_xml.py @@ -0,0 +1,56 @@ +#! /usr/bin/python2 +#Helper program that generates gen_is.xml thats custom to linhes. +#Contents of gen_is.xml are read from /etc/gen_is_xml.d +#This script should be run everytime a is.xml entry is added or removed + + +import os, sys +import glob + +def read_snippets(dir_name): + xml_snippets="" + try: + os.chdir(dir_name) + except: + print " gen_is_xml: Couldn't change dir to %s" %dir_name + print " Exiting" + sys.exit(2) + file_list=glob.glob("*.conf") + for conf_file in file_list: + try: + print " gen_is_xml: reading in %s" %conf_file + f=open(conf_file,'r') + lines=f.readlines() + f.close() + except: + print " gen_is_xml: Couldn't open %s for reading" %conf_file + print " Exiting" + sys.exit(2) + for line in lines: + xml_snippets+=line + if len(file_list) == 0: + print " gen_is_xml: no conf files found" + xml_snippets="" + + return xml_snippets + + +def write_xml(xml,filename): + try: + f=open(filename, 'w') + except: + print " gen_is_xml: Couldn't open %s" %(filename) + print " Exiting" + sys.exit(2) + f.write(xml) + f.close() + +def main(): + filename="/usr/share/mythtv/gen_is.xml" + is_xml_dir="/etc/gen_is_xml.d/" + xml_snippets=read_snippets(is_xml_dir) + xml='''<mythmenu name="Internet Steams">\n\n%s\n</mythmenu>\n''' %xml_snippets + write_xml(xml,filename) + +if __name__ == "__main__": + main()
\ No newline at end of file diff --git a/abs/core/LinHES-system/readme_is_xml b/abs/core/LinHES-system/readme_is_xml new file mode 100644 index 0000000..f4931b4 --- /dev/null +++ b/abs/core/LinHES-system/readme_is_xml @@ -0,0 +1 @@ +Files ending in .conf will be read by gen_is_xml.py and written out to is.xml |