This repository was archived by the owner on Oct 24, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ Version 0.2.4
66
77To be released.
88
9+ - Added :const: `sass.OUTPUT_STYLES ` constant map.
10+
911
1012Version 0.2.3
1113-------------
Original file line number Diff line number Diff line change 3838 :raises exceptions.IOError: when the ``filename `` doesn't exist or
3939 cannot be read
4040
41+ .. data :: OUTPUT_STYLES
42+
43+ (:class: `collections.Mapping `) The dictionary of output styles.
44+ Keys are output name strings, and values are flag integers.
45+
4146.. exception :: CompileError
4247
4348 The exception type that is raised by :func: `compile() `. It is a subtype
Original file line number Diff line number Diff line change @@ -272,13 +272,25 @@ static PyMethodDef PySass_methods[] = {
272272PyMODINIT_FUNC
273273initsass ()
274274{
275- PyObject * module , * version ;
275+ PyObject * module , * version , * output_styles ;
276+ size_t i = 0 ;
276277
277278 module = Py_InitModule3 ("sass" , PySass_methods ,
278279 "The thin binding of libsass for Python." );
279280 if (module == NULL ) {
280281 return ;
281282 }
283+
284+ output_styles = PyDict_New ();
285+ for (i = 0 ; PySass_output_style_enum [i ].label ; ++ i ) {
286+ PyDict_SetItemString (
287+ output_styles ,
288+ PySass_output_style_enum [i ].label ,
289+ PyInt_FromLong ((long ) PySass_output_style_enum [i ].value )
290+ );
291+ }
292+ PyModule_AddObject (module , "OUTPUT_STYLES" , output_styles );
293+
282294#ifdef LIBSASS_PYTHON_VERSION
283295 version = PyString_FromString (LIBSASS_PYTHON_VERSION );
284296#else
Original file line number Diff line number Diff line change 11from __future__ import with_statement
22from attest import assert_hook
33
4+ import collections
45import os .path
56import re
67import shutil
@@ -23,6 +24,13 @@ def version():
2324 assert re .match (r'^\d+\.\d+\.\d+$' , sass .__version__ )
2425
2526
27+ @suite .test
28+ def output_styles ():
29+ if hasattr (collections , 'Mapping' ):
30+ assert isinstance (sass .OUTPUT_STYLES , collections .Mapping )
31+ assert 'nested' in sass .OUTPUT_STYLES
32+
33+
2634@suite .test
2735def compile_required_arguments ():
2836 with raises (TypeError ):
You can’t perform that action at this time.
0 commit comments