Python babel 模块-numbers() 实例源码

Python babel 模块,numbers() 实例源码

我们从Python开源项目中,提取了以下50@H_404_8@个代码示例,用于说明如何使用babel.numbers()@H_404_8@。

项目:@H_404_8@Sci-Finder    作者:@H_404_8@snverse    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@Sci-Finder    作者:@H_404_8@snverse    | 项目源码 | 文件源码
def __init__(self, label=None, validators=None, places=unset_value, rounding=None, **kwargs):
        super(DecimalField, self).__init__(label, validators, **kwargs)
        if self.use_locale and (places is not unset_value or rounding is not None):
            raise TypeError(@H_502_206@"When using locale-aware numbers,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@Sci-Finder    作者:@H_404_8@snverse    | 项目源码 | 文件源码
def _extract_indices(self, prefix, formdata):
        """
        Yield indices of any keys with given prefix.

        formdata must be an object which will produce keys when iterated.  For
        example,if field 'foo' contains keys 'foo-0-bar','foo-1-baz',then
        the numbers 0 and 1 will be yielded,but not neccesarily in order.
        """
        offset = len(prefix) + 1
        for k in formdata:
            if k.startswith(prefix):
                k = k[offset:].split('-', 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@Sci-Finder    作者:@H_404_8@snverse    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@Sci-Finder    作者:@H_404_8@snverse    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@oa_qian    作者:@H_404_8@sunqb    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@oa_qian    作者:@H_404_8@sunqb    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@oa_qian    作者:@H_404_8@sunqb    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@chihu    作者:@H_404_8@yelongyu    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@chihu    作者:@H_404_8@yelongyu    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@chihu    作者:@H_404_8@yelongyu    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@FileStoreGAE    作者:@H_404_8@liantian-cn    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@FileStoreGAE    作者:@H_404_8@liantian-cn    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@FileStoreGAE    作者:@H_404_8@liantian-cn    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@python-group-proj    作者:@H_404_8@Sharcee    | @L_502_28@ | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@python-group-proj    作者:@H_404_8@Sharcee    | @L_502_28@ | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@python-group-proj    作者:@H_404_8@Sharcee    | @L_502_28@ | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@Flask-NvRay-Blog    作者:@H_404_8@rui7157    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@Flask-NvRay-Blog    作者:@H_404_8@rui7157    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@Flask-NvRay-Blog    作者:@H_404_8@rui7157    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@Flask-NvRay-Blog    作者:@H_404_8@rui7157    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@Flask-NvRay-Blog    作者:@H_404_8@rui7157    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@start    作者:@H_404_8@argeweb    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@start    作者:@H_404_8@argeweb    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@start    作者:@H_404_8@argeweb    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@webapp    作者:@H_404_8@superchilli    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@webapp    作者:@H_404_8@superchilli    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@webapp    作者:@H_404_8@superchilli    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@Sudoku-Solver    作者:@H_404_8@ayush1997    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@Sudoku-Solver    作者:@H_404_8@ayush1997    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@Sudoku-Solver    作者:@H_404_8@ayush1997    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@gardenbot    作者:@H_404_8@GoestaO    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@gardenbot    作者:@H_404_8@GoestaO    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@gardenbot    作者:@H_404_8@GoestaO    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@flask-zhenai-mongo-echarts    作者:@H_404_8@Fretice    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@flask-zhenai-mongo-echarts    作者:@H_404_8@Fretice    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@flask-zhenai-mongo-echarts    作者:@H_404_8@Fretice    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@micro-blog    作者:@H_404_8@nickChenyx    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@micro-blog    作者:@H_404_8@nickChenyx    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@micro-blog    作者:@H_404_8@nickChenyx    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@python-flask-security    作者:@H_404_8@weinbergdavid    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@python-flask-security    作者:@H_404_8@weinbergdavid    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@python-flask-security    作者:@H_404_8@weinbergdavid    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@Lixiang_zhaoxin    作者:@H_404_8@hejaxian    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@Lixiang_zhaoxin    作者:@H_404_8@hejaxian    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@Lixiang_zhaoxin    作者:@H_404_8@hejaxian    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@flask    作者:@H_404_8@bobohope    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')
项目:@H_404_8@flask    作者:@H_404_8@bobohope    | 项目源码 | 文件源码
def __init__(self,'places' and 'rounding' are ignored.")

        if places is unset_value:
            places = 2
        self.places = places
        self.rounding = rounding
项目:@H_404_8@flask    作者:@H_404_8@bobohope    | 项目源码 | 文件源码
def _extract_indices(self, 1)[0]
                if k.isdigit():
                    yield int(k)
项目:@H_404_8@Hawkeye    作者:@H_404_8@tozhengxq    | 项目源码 | 文件源码
def _init_babel(self):
        try:
            from babel import numbers
            self.babel_numbers = numbers
        except ImportError:
            raise ImportError('Using locale-aware decimals requires the babel library.')

相关文章

Python setuptools.dep_util 模块,newer_pairwise_group() ...
Python chainer.utils.type_check 模块,eval() 实例源码 我...
Python chainer.utils.type_check 模块,prod() 实例源码 我...
Python chainer.utils.type_check 模块,expect() 实例源码 ...
Python multiprocessing.managers 模块,BaseProxy() 实例源...
Python multiprocessing.managers 模块,RemoteError() 实例...