def __init__(
            self, root=Path(), search_path=(),
            namespace=None, extensions=(CoreExtension,),
            import_static_css=False,
            output_style='nested', generate_source_map=False,
            live_errors=False, warn_unused_imports=False,
            ignore_parse_errors=False,
            loops_have_own_scopes=True,
            undefined_variables_fatal=True,
            super_selector='',
            ):
        """Configure a compiler.

        :param root: Directory to treat as the "project root".  Search paths
            and some custom extensions (e.g. Compass) are relative to this
            directory.  Defaults to the current directory.
        :type root: :class:`pathlib.Path`
        :param search_path: List of paths to search for ``@import``s, relative
            to ``root``.  Absolute and parent paths are allowed here, but
            ``@import`` will refuse to load files that aren't in one of the
            directories here.  Defaults to only the root.
        :type search_path: list of strings, :class:`pathlib.Path` objects, or
            something that implements a similar interface (useful for custom
            pseudo filesystems)
        """
        # TODO perhaps polite to automatically cast any string paths to Path?
        # but have to be careful since the api explicitly allows dummy objects.
        if root is None:
            self.root = None
        else:
            self.root = root.resolve()

        self.search_path = tuple(
            self.normalize_path(path)
            for path in search_path
        )

        self.extensions = []
        if namespace is not None:
            self.extensions.append(NamespaceAdapterExtension(namespace))
        for extension in extensions:
            if isinstance(extension, Extension):
                self.extensions.append(extension)
            elif (isinstance(extension, type) and
                    issubclass(extension, Extension)):
                self.extensions.append(extension())
            elif isinstance(extension, Namespace):
                self.extensions.append(
                    NamespaceAdapterExtension(extension))
            else:
                raise TypeError(
                    "Expected an Extension or Namespace, got: {0!r}"
                    .format(extension)
                )

        if import_static_css:
            self.dynamic_extensions = ('.scss', '.sass', '.css')
            self.static_extensions = ()
        else:
            self.dynamic_extensions = ('.scss', '.sass')
            self.static_extensions = ('.css',)

        self.output_style = output_style
        self.generate_source_map = generate_source_map
        self.live_errors = live_errors
        self.warn_unused_imports = warn_unused_imports
        self.ignore_parse_errors = ignore_parse_errors
        self.loops_have_own_scopes = loops_have_own_scopes
        self.undefined_variables_fatal = undefined_variables_fatal
        self.super_selector = super_selector
def __init__ ( self , root = Path ( ) , search_path = ( ) , namespace = None , extensions = ( CoreExtension , ) , import_static_css = False , output_style = 'nested' , generate_source_map = False , live_errors = False , warn_unused_imports = False , ignore_parse_errors = False , loops_have_own_scopes = True , undefined_variables_fatal = True , super_selector = '' , ) : if root is None : self . root = None else : self . root = root . resolve ( ) self . search_path = tuple ( self . normalize_path ( path ) for path in search_path ) self . extensions = [ ] if namespace is not None : self . extensions . append ( NamespaceAdapterExtension ( namespace ) ) for extension in extensions : if isinstance ( extension , Extension ) : self . extensions . append ( extension ) elif ( isinstance ( extension , type ) and issubclass ( extension , Extension ) ) : self . extensions . append ( extension ( ) ) elif isinstance ( extension , Namespace ) : self . extensions . append ( NamespaceAdapterExtension ( extension ) ) else : raise TypeError ( "Expected an Extension or Namespace, got: {0!r}" . format ( extension ) ) if import_static_css : self . dynamic_extensions = ( '.scss' , '.sass' , '.css' ) self . static_extensions = ( ) else : self . dynamic_extensions = ( '.scss' , '.sass' ) self . static_extensions = ( '.css' , ) self . output_style = output_style self . generate_source_map = generate_source_map self . live_errors = live_errors self . warn_unused_imports = warn_unused_imports self . ignore_parse_errors = ignore_parse_errors self . loops_have_own_scopes = loops_have_own_scopes self . undefined_variables_fatal = undefined_variables_fatal self . super_selector = super_selector
Configure a compiler.

        :param root: Directory to treat as the "project root".  Search paths
            and some custom extensions (e.g. Compass) are relative to this
            directory.  Defaults to the current directory.
        :type root: :class:`pathlib.Path`
        :param search_path: List of paths to search for ``@import``s, relative
            to ``root``.  Absolute and parent paths are allowed here, but
            ``@import`` will refuse to load files that aren't in one of the
            directories here.  Defaults to only the root.
        :type search_path: list of strings, :class:`pathlib.Path` objects, or
            something that implements a similar interface (useful for custom
            pseudo filesystems)