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

All Samples(26)  |  Call(23)  |  Derive(0)  |  Import(3)
Wrapper class providing the various date and number formatting functions
bound to a specific locale and time-zone.

>>> from babel.util import UTC
>>> from datetime import date
>>> fmt = Format('en_US', UTC)
>>> fmt.date(date(2007, 4, 1))
u'Apr 1, 2007'
>>> fmt.decimal(1.2345)
u'1.234'

src/z/a/zamboni-HEAD/apps/amo/helpers.py   zamboni(Download)
import jinja2
import six
from babel.support import Format
from jingo import register, env
# Needed to make sure our own |f filter overrides jingo's one.
def _get_format():
    lang = translation.get_language()
    return Format(utils.get_locale_from_lang(lang))
 
 

src/r/e/reporter-HEAD/apps/input/helpers.py   reporter(Download)
 
from babel import Locale, UnknownLocaleError
from babel.support import Format
from jingo import register
import jinja2
        locale = Locale(translation.to_locale(settings.BABEL_FALLBACK.get(
            lang, 'en-US')))
    return Format(locale)
 
 

src/f/j/fjord-HEAD/vendor/packages/Babel/tests/test_support.py   fjord(Download)
def test_format_date():
    fmt = support.Format('en_US')
    assert fmt.date(date(2007, 4, 1)) == 'Apr 1, 2007'
 
 
def test_format_datetime():
    from pytz import timezone
    fmt = support.Format('en_US', tzinfo=timezone('US/Eastern'))
def test_format_time():
    from pytz import timezone
    fmt = support.Format('en_US', tzinfo=timezone('US/Eastern'))
    assert fmt.time(datetime(2007, 4, 1, 15, 30)) == '11:30:00 AM'
 
 
def test_format_timedelta():
    fmt = support.Format('en_US')
def test_format_number():
    fmt = support.Format('en_US')
    assert fmt.number(1099) == '1,099'
 
 

src/z/e/ZenPacks.zenoss.OpenStack-HEAD/src/Babel-1.3/tests/test_support.py   ZenPacks.zenoss.OpenStack(Download)
def test_format_date():
    fmt = support.Format('en_US')
    assert fmt.date(date(2007, 4, 1)) == 'Apr 1, 2007'
 
 
def test_format_datetime():
    from pytz import timezone
    fmt = support.Format('en_US', tzinfo=timezone('US/Eastern'))
def test_format_time():
    from pytz import timezone
    fmt = support.Format('en_US', tzinfo=timezone('US/Eastern'))
    assert fmt.time(datetime(2007, 4, 1, 15, 30)) == '11:30:00 AM'
 
 
def test_format_timedelta():
    fmt = support.Format('en_US')
def test_format_number():
    fmt = support.Format('en_US')
    assert fmt.number(1099) == '1,099'
 
 

src/b/a/Babel-1.3/tests/test_support.py   Babel(Download)
def test_format_date():
    fmt = support.Format('en_US')
    assert fmt.date(date(2007, 4, 1)) == 'Apr 1, 2007'
 
 
def test_format_datetime():
    from pytz import timezone
    fmt = support.Format('en_US', tzinfo=timezone('US/Eastern'))
def test_format_time():
    from pytz import timezone
    fmt = support.Format('en_US', tzinfo=timezone('US/Eastern'))
    assert fmt.time(datetime(2007, 4, 1, 15, 30)) == '11:30:00 AM'
 
 
def test_format_timedelta():
    fmt = support.Format('en_US')
def test_format_number():
    fmt = support.Format('en_US')
    assert fmt.number(1099) == '1,099'
 
 

src/k/i/kitsune-HEAD/kitsune/sumo/form_fields.py   kitsune(Download)
 
from babel import Locale, localedata
from babel.support import Format
from tower import ugettext as _, ugettext_lazy as _lazy