diff options
author | James Meyer <james.meyer@operamail.com> | 2012-09-29 20:08:18 (GMT) |
---|---|---|
committer | James Meyer <james.meyer@operamail.com> | 2012-09-29 20:08:18 (GMT) |
commit | 95144ae80ab0a96d02c11d4219f6841f59acf5fa (patch) | |
tree | 9e5761737bda6de8b4be4ca246435c6d6e2c750b /abs/core | |
parent | 2b396807e70b58d7278825a5edd59ea1ddb9f648 (diff) | |
download | linhes_pkgbuild-95144ae80ab0a96d02c11d4219f6841f59acf5fa.zip linhes_pkgbuild-95144ae80ab0a96d02c11d4219f6841f59acf5fa.tar.gz linhes_pkgbuild-95144ae80ab0a96d02c11d4219f6841f59acf5fa.tar.bz2 |
LinHES-config: timezip.py add lookup support for windowmanager and enhanced during install
Diffstat (limited to 'abs/core')
-rwxr-xr-x | abs/core/LinHES-config/timezip.py | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/abs/core/LinHES-config/timezip.py b/abs/core/LinHES-config/timezip.py index 4e494be..625350b 100755 --- a/abs/core/LinHES-config/timezip.py +++ b/abs/core/LinHES-config/timezip.py @@ -27,6 +27,8 @@ def printvars(): print "nfstoggle:" + nfstoggle print "nfsmount:" + nfsmount print "hobbitclient:" + hobbitclient + print "windowmanager:" + windowmanager + print "windowmanager style:" + wmstyle # connect def selectvars(): @@ -39,6 +41,8 @@ def selectvars(): global nfstoggle global nfsmount global hobbitclient + global windowmanager + global wmstyle db = MySQLdb.connect(host=masterdb, user="mythtv", passwd="mythtv", db="mythconverg") # create a cursor @@ -112,6 +116,21 @@ def selectvars(): hobbitclient="1" + cursor.execute("select data from settings where value='HostWindowManager' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + windowmanager=result[0] + except TypeError: + windowmanager="default" + + cursor.execute("select data from settings where value='HostEnhancedWMStyle' and hostname=(%s)",(BEhostname)) + result = cursor.fetchone() + try: + wmstyle=result[0] + except TypeError: + wmstyle="0" + + def insertvars(): db = MySQLdb.connect(host=installdb, user="mythtv", passwd="mythtv", db="mythconverg") @@ -193,6 +212,26 @@ def insertvars(): cursor.execute("update settings set data=(%s) where hostname=(%s) and value='HostServiceHobbitclient'",(hobbitclient,thishostname)) print "updating hobbitclient" + #windowmanager + cursor.execute("select * from settings where value='HostWindowManager' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostWindowManager',(%s),(%s))",(windowmanager,thishostname)) + print "inserting windowmanager" + else: + cursor.execute("update settings set data=(%s) where hostname=(%s) and value='HostWindowManager'",(windowmanager,thishostname)) + print "updating windowmanager" + + + cursor.execute("select * from settings where value='HostEnhancedWMStyle' and hostname=(%s)",(thishostname)) + result = cursor.fetchone() + if (result == None): + cursor.execute("INSERT INTO settings (value,data,hostname) VALUES ('HostEnhancedWMStyle',(%s),(%s))",(wmstyle,thishostname)) + print "inserting windowmanager style" + else: + cursor.execute("update settings set data=(%s) where hostname=(%s) and value='HostEnhancedWMStyle'",(wmstyle,thishostname)) + print "updating windowmanager style" + def main(argv): global masterdb @@ -204,9 +243,9 @@ def main(argv): global tz global tz_region global tz_subregion - global nfsip global hobbitclient + try: opts, args = getopt.getopt(argv, "hm:d:n:", ["help", "masterdb=", "installdb=" , "hostname=" ] ) except getopt.GetoptError: |