Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(10)  |  Call(7)  |  Derive(0)  |  Import(3)
Return the names for day periods (AM/PM) used by the locale.

>>> get_period_names(locale='en_US')['am']
u'AM'

:param locale: the `Locale` object, or a locale string

        def get_period_names(locale=LC_TIME):
    """Return the names for day periods (AM/PM) used by the locale.

    >>> get_period_names(locale='en_US')['am']
    u'AM'

    :param locale: the `Locale` object, or a locale string
    """
    return Locale.parse(locale).periods
        


src/b/l/bloodhound-HEAD/trac/trac/util/datefmt.py   bloodhound(Download)
    from babel import Locale
    from babel.core import LOCALE_ALIASES
    from babel.dates import (
        format_datetime as babel_format_datetime,
        format_date as babel_format_date,
    period_names = {'am': 'am', 'pm': 'pm'}
    if formats[0].find('%(a)s') != -1:
        names = get_period_names(locale=locale)
        for period, name in names.iteritems():
            name = name.lower()

src/t/r/Trac-1.0.1/trac/util/datefmt.py   Trac(Download)
    from babel import Locale
    from babel.core import LOCALE_ALIASES
    from babel.dates import (
        format_datetime as babel_format_datetime,
        format_date as babel_format_date,
    period_names = {'am': 'am', 'pm': 'pm'}
    if formats[0].find('%(a)s') != -1:
        names = get_period_names(locale=locale)
        for period, name in names.iteritems():
            name = name.lower()

src/t/r/trac-HEAD/trac/util/datefmt.py   trac(Download)
    from babel import Locale
    from babel.core import LOCALE_ALIASES, UnknownLocaleError
    from babel.dates import (
        format_datetime as babel_format_datetime,
        format_date as babel_format_date,
                                   for num, name in names.iteritems())
        if formats[0].find('%(a)s') != -1:
            names = get_period_names(locale=locale)
            period_names.update((name.lower(), period)
                                for period, name in names.iteritems()

src/n/a/nagare-0.4.1/nagare/i18n.py   nagare(Download)
        u'AM'
        """
        return dates.get_period_names(self)
 
    def get_day_names(self, width='wide', context='format'):

src/f/j/fjord-HEAD/vendor/packages/Babel/tests/test_dates.py   fjord(Download)
def test_get_period_names():
    assert dates.get_period_names(locale='en_US')['am'] == u'AM'
 
 
def test_get_day_names():

src/z/e/ZenPacks.zenoss.OpenStack-HEAD/src/Babel-1.3/tests/test_dates.py   ZenPacks.zenoss.OpenStack(Download)
def test_get_period_names():
    assert dates.get_period_names(locale='en_US')['am'] == u'AM'
 
 
def test_get_day_names():

src/b/a/Babel-1.3/tests/test_dates.py   Babel(Download)
def test_get_period_names():
    assert dates.get_period_names(locale='en_US')['am'] == u'AM'
 
 
def test_get_day_names():