當前位置: 首頁>>代碼示例>>Python>>正文


Python settings.__module__方法代碼示例

本文整理匯總了Python中django.conf.settings.__module__方法的典型用法代碼示例。如果您正苦於以下問題:Python settings.__module__方法的具體用法?Python settings.__module__怎麽用?Python settings.__module__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在django.conf.settings的用法示例。


在下文中一共展示了settings.__module__方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _init_translation_catalog

# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import __module__ [as 別名]
def _init_translation_catalog(self):
        """Creates a base catalog using global django translations."""
        settingsfile = upath(sys.modules[settings.__module__].__file__)
        localedir = os.path.join(os.path.dirname(settingsfile), 'locale')
        use_null_fallback = True
        if self.__language == settings.LANGUAGE_CODE:
            # default lang should be present and parseable, if not
            # gettext will raise an IOError (refs #18192).
            use_null_fallback = False
        translation = self._new_gnu_trans(localedir, use_null_fallback)
        self.plural = translation.plural
        self._info = translation._info.copy()
        self._catalog = translation._catalog.copy() 
開發者ID:lanbing510,項目名稱:GTDWeb,代碼行數:15,代碼來源:trans_real.py

示例2: all_locale_paths

# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import __module__ [as 別名]
def all_locale_paths():
    """
    Returns a list of paths to user-provides languages files.
    """
    globalpath = os.path.join(
        os.path.dirname(upath(sys.modules[settings.__module__].__file__)), 'locale')
    return [globalpath] + list(settings.LOCALE_PATHS) 
開發者ID:lanbing510,項目名稱:GTDWeb,代碼行數:9,代碼來源:trans_real.py

示例3: _init_translation_catalog

# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import __module__ [as 別名]
def _init_translation_catalog(self):
        """Create a base catalog using global django translations."""
        settingsfile = sys.modules[settings.__module__].__file__
        localedir = os.path.join(os.path.dirname(settingsfile), 'locale')
        translation = self._new_gnu_trans(localedir)
        self.merge(translation) 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:8,代碼來源:trans_real.py

示例4: all_locale_paths

# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import __module__ [as 別名]
def all_locale_paths():
    """
    Return a list of paths to user-provides languages files.
    """
    globalpath = os.path.join(
        os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
    return [globalpath] + list(settings.LOCALE_PATHS) 
開發者ID:reBiocoder,項目名稱:bioforum,代碼行數:9,代碼來源:trans_real.py

示例5: all_locale_paths

# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import __module__ [as 別名]
def all_locale_paths():
    """
    Return a list of paths to user-provides languages files.
    """
    globalpath = os.path.join(
        os.path.dirname(sys.modules[settings.__module__].__file__), 'locale')
    app_paths = []
    for app_config in apps.get_app_configs():
        locale_path = os.path.join(app_config.path, 'locale')
        if os.path.exists(locale_path):
            app_paths.append(locale_path)
    return [globalpath] + list(settings.LOCALE_PATHS) + app_paths 
開發者ID:PacktPublishing,項目名稱:Hands-On-Application-Development-with-PyCharm,代碼行數:14,代碼來源:trans_real.py

示例6: _init_translation_catalog

# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import __module__ [as 別名]
def _init_translation_catalog(self):
        """Creates a base catalog using global django translations."""
        settingsfile = upath(sys.modules[settings.__module__].__file__)
        localedir = os.path.join(os.path.dirname(settingsfile), 'locale')
        translation = self._new_gnu_trans(localedir)
        self.merge(translation) 
開發者ID:Yeah-Kun,項目名稱:python,代碼行數:8,代碼來源:trans_real.py

示例7: all_locale_paths

# 需要導入模塊: from django.conf import settings [as 別名]
# 或者: from django.conf.settings import __module__ [as 別名]
def all_locale_paths():
    """
    Returns a list of paths to user-provides languages files.
    """
    from django.conf import settings
    globalpath = os.path.join(
        os.path.dirname(upath(sys.modules[settings.__module__].__file__)), 'locale')
    return [globalpath] + list(settings.LOCALE_PATHS) 
開發者ID:blackye,項目名稱:luscan-devel,代碼行數:10,代碼來源:trans_real.py


注:本文中的django.conf.settings.__module__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。