File: types.py

package info (click to toggle)
django-sass-processor 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 236 kB
  • sloc: python: 763; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 330 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
from decimal import Decimal
from sass import SassNumber as _SassNumber, SassColor, SassList, SassMap

__all__ = ['SassNumber', 'SassColor', 'SassList', 'SassMap']


def SassNumber(value):
    if isinstance(value, (int, float, Decimal)):
        return str(_SassNumber(value, type(value).__name__.encode()).value)
    return value