[tuxdroid-svn] r5433 - software_suite_v3/smart-core/smart-server/branches/user_mode/resources/05_us
Status: Beta
Brought to you by:
ks156
|
From: ks156 <c2m...@c2...> - 2009-09-17 11:57:32
|
Author: ks156
Date: 2009-09-17 13:57:24 +0200 (Thu, 17 Sep 2009)
New Revision: 5433
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/05_user_configurations/00_resourceUsers.py
Log:
* Update the configuration file if the installed voices had changed.
Modified: software_suite_v3/smart-core/smart-server/branches/user_mode/resources/05_user_configurations/00_resourceUsers.py
===================================================================
--- software_suite_v3/smart-core/smart-server/branches/user_mode/resources/05_user_configurations/00_resourceUsers.py 2009-09-17 11:34:22 UTC (rev 5432)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/resources/05_user_configurations/00_resourceUsers.py 2009-09-17 11:57:24 UTC (rev 5433)
@@ -74,8 +74,24 @@
# If the server has been started as normal user on Linux and
# if the user configuration file doesn't exists, copy the master
# configuration located in /etc/tuxdroid/users_conf/default/user.conf
- if not os.path.isfile(userConfFile) and os.name != 'nt':
- if systemPaths.isUser():
+ if systemPaths.isUser() and os.name != 'nt':
+ try:
+ f_sys = open("/etc/tuxdroid/users_conf/default/user.conf", "r")
+ dict = eval(f_sys.read())
+ f_sys.close()
+ lang_sys = dict['language1']
+ except:
+ lang_sys = None
+ try:
+ path = os.path.join(systemPaths.getUserConfPath(), "default", "user.conf")
+ f_user = open(path, "r")
+ dict = eval(f_user.read())
+ f_user.close()
+ lang_user = dict['language1']
+ except:
+ lang_user = None
+
+ if lang_user != lang_sys and lang_user != None and lang_sys != None:
os.system("cp /etc/tuxdroid/users_conf/default/user.conf %s"%userConfFile)
if not os.path.isfile(userConfFile):
|