本文整理汇总了Python中lucterios.CORE.parameters.Params.gettext方法的典型用法代码示例。如果您正苦于以下问题:Python Params.gettext方法的具体用法?Python Params.gettext怎么用?Python Params.gettext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类lucterios.CORE.parameters.Params
的用法示例。
在下文中一共展示了Params.gettext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: read
# 需要导入模块: from lucterios.CORE.parameters import Params [as 别名]
# 或者: from lucterios.CORE.parameters.Params import gettext [as 别名]
def read(self):
clear_modules()
import django.conf
if self.name == '':
raise AdminException("Instance not precise!")
if not isfile(self.setting_path) or not isfile(self.instance_conf):
raise AdminException("Instance not exists !")
os.environ[django.conf.ENVIRONMENT_VARIABLE] = self.setting_module_name
if self.setting_module_name in sys.modules.keys():
mod_set = sys.modules[self.setting_module_name]
del mod_set
del sys.modules[self.setting_module_name]
import_module(self.setting_module_name)
import_module("django.conf")
django.setup()
self.secret_key = django.conf.settings.SECRET_KEY
self.extra = django.conf.settings.EXTRA
self.databases = django.conf.settings.DATABASES
self.database = django.conf.settings.DATABASES['default']['ENGINE']
if "sqlite3" in self.database:
self.database = ('sqlite', {})
if "mysql" in self.database:
self.database = ('mysql', self._get_db_info_())
if "postgresql" in self.database:
self.database = ('postgresql', self._get_db_info_())
self.appli_name = django.conf.settings.APPLIS_MODULE.__name__
self.modules = ()
for appname in django.conf.settings.INSTALLED_APPS:
if ("django" not in appname) and (appname != 'lucterios.framework') and (appname != 'lucterios.CORE') and (self.appli_name != appname):
self.modules = self.modules + (six.text_type(appname),)
from lucterios.CORE.parameters import Params
from lucterios.framework.error import LucteriosException
try:
self.extra[''] = {'mode': (
Params.getvalue("CORE-connectmode"), Params.gettext("CORE-connectmode"))}
except LucteriosException:
self.extra[''] = {'mode': None}
self.print_info_("""Instance %s:
path\t%s
appli\t%s
database\t%s
modules\t%s
extra\t%s
""" % (self.name, self.instance_dir, self.get_appli_txt(), self.get_database_txt(), self.get_module_txt(), self.get_extra_txt()))
return