##// END OF EJS Templates
system-info: fetch default locale to the provided system info data.
marcink -
r2914:57425d44 default
parent child Browse files
Show More
@@ -112,6 +112,7 b' class AdminSystemInfoSettingsView(BaseAp'
112 # Platform/Python
112 # Platform/Python
113 (_('Platform'), val('platform')['name'], state('platform')),
113 (_('Platform'), val('platform')['name'], state('platform')),
114 (_('Platform UUID'), val('platform')['uuid'], state('platform')),
114 (_('Platform UUID'), val('platform')['uuid'], state('platform')),
115 (_('Lang'), val('locale'), state('locale')),
115 (_('Python version'), val('python')['version'], state('python')),
116 (_('Python version'), val('python')['version'], state('python')),
116 (_('Python path'), val('python')['executable'], state('python')),
117 (_('Python path'), val('python')['executable'], state('python')),
117 ('', '', ''), # spacer
118 ('', '', ''), # spacer
@@ -142,6 +142,21 b' def platform_type():'
142 return SysInfoRes(value=value)
142 return SysInfoRes(value=value)
143
143
144
144
145 def locale_info():
146 import locale
147
148 value = dict(
149 locale_default=locale.getdefaultlocale(),
150 locale_lc_all=locale.getlocale(locale.LC_ALL),
151 lang_env=os.environ.get('LANG'),
152 lc_all_env=os.environ.get('LC_ALL'),
153 local_archive_env=os.environ.get('LOCALE_ARCHIVE'),
154 )
155 human_value = 'LANG: {}, locale LC_ALL: {}, Default locales: {}'.format(
156 value['lang_env'], value['locale_lc_all'], value['locale_default'])
157 return SysInfoRes(value=value, human_value=human_value)
158
159
145 def ulimit_info():
160 def ulimit_info():
146 data = collections.OrderedDict([
161 data = collections.OrderedDict([
147 ('cpu time (seconds)', resource.getrlimit(resource.RLIMIT_CPU)),
162 ('cpu time (seconds)', resource.getrlimit(resource.RLIMIT_CPU)),
@@ -712,7 +727,6 b' def usage_info():'
712 return SysInfoRes(value=value)
727 return SysInfoRes(value=value)
713
728
714
729
715
716 def get_system_info(environ):
730 def get_system_info(environ):
717 environ = environ or {}
731 environ = environ or {}
718 return {
732 return {
@@ -723,6 +737,7 b' def get_system_info(environ):'
723 'py_modules': SysInfo(py_modules)(),
737 'py_modules': SysInfo(py_modules)(),
724
738
725 'platform': SysInfo(platform_type)(),
739 'platform': SysInfo(platform_type)(),
740 'locale': SysInfo(locale_info)(),
726 'server': SysInfo(server_info, environ=environ)(),
741 'server': SysInfo(server_info, environ=environ)(),
727 'database': SysInfo(database_info)(),
742 'database': SysInfo(database_info)(),
728 'ulimit': SysInfo(ulimit_info)(),
743 'ulimit': SysInfo(ulimit_info)(),
General Comments 0
You need to be logged in to leave comments. Login now