[tuxdroid-svn] r5438 - 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-18 08:45:20
|
Author: ks156
Date: 2009-09-18 10:45:07 +0200 (Fri, 18 Sep 2009)
New Revision: 5438
Modified:
software_suite_v3/smart-core/smart-server/branches/user_mode/resources/05_user_configurations/00_resourceUsers.py
Log:
* Fixed a bug with the user conf file
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-18 08:42:41 UTC (rev 5437)
+++ software_suite_v3/smart-core/smart-server/branches/user_mode/resources/05_user_configurations/00_resourceUsers.py 2009-09-18 08:45:07 UTC (rev 5438)
@@ -75,25 +75,28 @@
# if the user configuration file doesn't exists, copy the master
# configuration located in /etc/tuxdroid/users_conf/default/user.conf
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:
+ if not os.path.isfile(userConfFile):
os.system("cp /etc/tuxdroid/users_conf/default/user.conf %s"%userConfFile)
+ else:
+ 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):
# Create default configuration
splitedLC = TUXDROID_LANGUAGE.split("_")
|