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

All Samples(258)  |  Call(258)  |  Derive(0)  |  Import(0)
Create a `Locale` instance for the given locale identifier.

>>> l = Locale.parse('de-DE', sep='-')
>>> l.display_name
u'Deutsch (Deutschland)'

If the `identifier` parameter is not a string, but actually a `Locale`
object, that object is returned:

>>> Locale.parse(l)(more...)

src/w/e/WebPutty-HEAD/libs/babel/messages/frontend.py   WebPutty(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError, e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError, e:
            parser.error(e)

src/z/e/ZenPacks.zenoss.OpenStack-HEAD/src/Babel-1.3/babel/messages/frontend.py   ZenPacks.zenoss.OpenStack(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError as e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print(output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError as e:
            parser.error(e)

src/s/o/solace-HEAD/solace/models.py   solace(Download)
    def __init__(self, locale, title, text, user, date=None):
        self.locale = Locale.parse(locale)
        self.title = title
        # start with -1, when the question post is created the code will
        # increment it to zero automatically.
    def __init__(self, user, locale):
        self.user = user
        self.locale = Locale.parse(locale)
        self.counter = 0
        self.first_activity = self.last_activity = datetime.utcnow()
    def __init__(self, name, locale):
        self.name = name
        self.locale = Locale.parse(locale)
        self.tagged = 0
        session.add(self)

src/f/i/FireCheckIn-HEAD/kay/lib/babel/messages/frontend.py   FireCheckIn(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError, e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError, e:
            parser.error(e)

src/b/l/bloodhound-HEAD/trac/trac/util/datefmt.py   bloodhound(Download)
    if babel and locale:
        if not locale.territory and locale.language in LOCALE_ALIASES:
            locale = Locale.parse(LOCALE_ALIASES[locale.language])
        return (locale.first_week_day + 1) % 7
    return 0 # Sunday
def _i18n_parse_date(text, tzinfo, locale):
    locale = Locale.parse(locale)
    key = str(locale)
    pattern = _I18N_PARSE_DATE_PATTERNS.get(key)
    if pattern is False:

src/k/a/kay-HEAD/kay/lib/babel/messages/frontend.py   kay(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError, e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError, e:
            parser.error(e)

src/w/e/webapp-improved-HEAD/lib/babel/babel/messages/frontend.py   webapp-improved(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError, e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError, e:
            parser.error(e)

src/a/l/algae-HEAD/gae/libs/babel/messages/frontend.py   algae(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError, e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in identifiers:
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError, e:
            parser.error(e)

src/t/r/Trac-1.0.1/trac/util/datefmt.py   Trac(Download)
    if babel and locale:
        if not locale.territory and locale.language in LOCALE_ALIASES:
            locale = Locale.parse(LOCALE_ALIASES[locale.language])
        return (locale.first_week_day + 1) % 7
    return 0 # Sunday
def _i18n_parse_date(text, tzinfo, locale):
    locale = Locale.parse(locale)
    key = str(locale)
    pattern = _I18N_PARSE_DATE_PATTERNS.get(key)
    if pattern is False:

src/p/l/playdoh-lib-HEAD/lib/python/babel/messages/frontend.py   playdoh-lib(Download)
                                       'new catalog')
        try:
            self._locale = Locale.parse(self.locale)
        except UnknownLocaleError, e:
            raise DistutilsOptionError(e)
            format = u'%%-%ds %%s' % (longest + 1)
            for identifier in localedata.list():
                locale = Locale.parse(identifier)
                output = format % (identifier, locale.english_name)
                print output.encode(sys.stdout.encoding or
            parser.error('you must provide a locale for the new catalog')
        try:
            locale = Locale.parse(options.locale)
        except UnknownLocaleError, e:
            parser.error(e)

Previous  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10  Next