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("_")
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn