Skip to content

Use the python3 names in docstrings #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions sass.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,20 @@
libsass_version = _sass.libsass_version


#: (:class:`collections.Mapping`) The dictionary of output styles.
#: (:class:`collections.abc.Mapping`) The dictionary of output styles.
#: Keys are output name strings, and values are flag integers.
OUTPUT_STYLES = _sass.OUTPUT_STYLES

#: (:class:`collections.Mapping`) The dictionary of source comments styles.
#: (:class:`collections.abc.Mapping`) The dictionary of source comments styles.
#: Keys are mode names, and values are corresponding flag integers.
#:
#: .. versionadded:: 0.4.0
#:
#: .. deprecated:: 0.6.0
SOURCE_COMMENTS = {'none': 0, 'line_numbers': 1, 'default': 1, 'map': 2}

#: (:class:`collections.Set`) The set of keywords :func:`compile()` can take.
MODES = set(['string', 'filename', 'dirname'])
#: (:class:`frozenset`) The set of keywords :func:`compile()` can take.
MODES = frozenset(('string', 'filename', 'dirname'))


def to_native_s(s):
Expand Down Expand Up @@ -83,9 +83,9 @@ class SassFunction(object):
:param name: the function name
:type name: :class:`str`
:param arguments: the argument names
:type arguments: :class:`collections.Sequence`
:type arguments: :class:`collections.abc.Sequence`
:param callable_: the actual function to be called
:type callable_: :class:`collections.Callable`
:type callable_: :class:`collections.abc.Callable`

.. versionadded:: 0.7.0

Expand Down Expand Up @@ -283,23 +283,23 @@ def compile(**kwargs):
:type source_comments: :class:`bool`
:param include_paths: an optional list of paths to find ``@import``\ ed
Sass/CSS source files
:type include_paths: :class:`collections.Sequence`
:type include_paths: :class:`collections.abc.Sequence`
:param precision: optional precision for numbers. :const:`5` by default.
:type precision: :class:`int`
:param custom_functions: optional mapping of custom functions.
see also below `custom functions
<custom-functions_>`_ description
:type custom_functions: :class:`collections.Set`,
:class:`collections.Sequence`,
:class:`collections.Mapping`
:type custom_functions: :class:`set`,
:class:`collections.abc.Sequence`,
:class:`collections.abc.Mapping`
:param indented: optional declaration that the string is Sass, not SCSS
formatted. :const:`False` by default
:type indented: :class:`bool`
:returns: the compiled CSS string
:param importers: optional callback functions.
see also below `importer callbacks
<importer-callbacks_>`_ description
:type importers: :class:`collections.Callable`
:type importers: :class:`collections.abc.Callable`
:rtype: :class:`str`
:raises sass.CompileError: when it fails for any reason
(for example the given Sass has broken syntax)
Expand All @@ -323,19 +323,19 @@ def compile(**kwargs):
:type source_map_filename: :class:`str`
:param include_paths: an optional list of paths to find ``@import``\ ed
Sass/CSS source files
:type include_paths: :class:`collections.Sequence`
:type include_paths: :class:`collections.abc.Sequence`
:param precision: optional precision for numbers. :const:`5` by default.
:type precision: :class:`int`
:param custom_functions: optional mapping of custom functions.
see also below `custom functions
<custom-functions_>`_ description
:type custom_functions: :class:`collections.Set`,
:class:`collections.Sequence`,
:class:`collections.Mapping`
:type custom_functions: :class:`set`,
:class:`collections.abc.Sequence`,
:class:`collections.abc.Mapping`
:param importers: optional callback functions.
see also below `importer callbacks
<importer-callbacks_>`_ description
:type importers: :class:`collections.Callable`
:type importers: :class:`collections.abc.Callable`
:returns: the compiled CSS string, or a pair of the compiled CSS string
and the source map string if ``source_map_filename`` is set
:rtype: :class:`str`, :class:`tuple`
Expand Down Expand Up @@ -365,23 +365,23 @@ def compile(**kwargs):
:type source_comments: :class:`bool`
:param include_paths: an optional list of paths to find ``@import``\ ed
Sass/CSS source files
:type include_paths: :class:`collections.Sequence`
:type include_paths: :class:`collections.abc.Sequence`
:param precision: optional precision for numbers. :const:`5` by default.
:type precision: :class:`int`
:param custom_functions: optional mapping of custom functions.
see also below `custom functions
<custom-functions_>`_ description
:type custom_functions: :class:`collections.Set`,
:class:`collections.Sequence`,
:class:`collections.Mapping`
:type custom_functions: :class:`set`,
:class:`collections.abc.Sequence`,
:class:`collections.abc.Mapping`
:raises sass.CompileError: when it fails for any reason
(for example the given Sass has broken syntax)

.. _custom-functions:

The ``custom_functions`` parameter can take three types of forms:

:class:`~collections.Set`/:class:`~collections.Sequence` of \
:class:`~set`/:class:`~collections.abc.Sequence` of \
:class:`SassFunction`\ s
It is the most general form. Although pretty verbose, it can take
any kind of callables like type objects, unnamed functions,
Expand All @@ -397,7 +397,7 @@ def compile(**kwargs):
}
)

:class:`~collections.Mapping` of names to functions
:class:`~collections.abc.Mapping` of names to functions
Less general, but easier-to-use form. Although it's not it can take
any kind of callables, it can take any kind of *functions* defined
using :keyword:`def`/:keyword:`lambda` syntax.
Expand All @@ -414,7 +414,7 @@ def compile(**kwargs):
}
)

:class:`~collections.Set`/:class:`~collections.Sequence` of \
:class:`~set`/:class:`~collections.abc.Sequence` of \
named functions
Not general, but the easiest-to-use form for *named* functions.
It can take only named functions, defined using :keyword:`def`.
Expand Down Expand Up @@ -647,7 +647,7 @@ def and_join(strings):
'Korea, Japan, China, and Taiwan'

:param strings: a list of words to join
:type string: :class:`collections.Sequence`
:type string: :class:`collections.abc.Sequence`
:returns: a joined string
:rtype: :class:`str`, :class:`basestring`

Expand Down
8 changes: 4 additions & 4 deletions sassutils/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
__all__ = 'SUFFIXES', 'SUFFIX_PATTERN', 'Manifest', 'build_directory'


#: (:class:`collections.Set`) The set of supported filename suffixes.
SUFFIXES = frozenset(['sass', 'scss'])
#: (:class:`frozenset`) The set of supported filename suffixes.
SUFFIXES = frozenset(('sass', 'scss'))

#: (:class:`re.RegexObject`) The regular expression pattern which matches to
#: filenames of supported :const:`SUFFIXES`.
Expand All @@ -39,7 +39,7 @@ def build_directory(sass_path, css_path, output_style='nested',
``'compact'``, ``'compressed'``
:type output_style: :class:`str`
:returns: a dictionary of source filenames to compiled CSS filenames
:rtype: :class:`collections.Mapping`
:rtype: :class:`collections.abc.Mapping`

.. versionadded:: 0.6.0
The ``output_style`` parameter.
Expand Down Expand Up @@ -165,7 +165,7 @@ def build(self, package_dir, output_style='nested'):
``'expanded'``, ``'compact'``, ``'compressed'``
:type output_style: :class:`str`
:returns: the set of compiled CSS filenames
:rtype: :class:`collections.Set`
:rtype: :class:`frozenset`

.. versionadded:: 0.6.0
The ``output_style`` parameter.
Expand Down
6 changes: 3 additions & 3 deletions sassutils/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ class SassMiddleware(object):
logging.basicConfig()

:param app: the WSGI application to wrap
:type app: :class:`collections.Callable`
:type app: :class:`collections.abc.Callable`
:param manifests: build settings. the same format to
:file:`setup.py` script's ``sass_manifests``
option
:type manifests: :class:`collections.Mapping`
:type manifests: :class:`collections.abc.Mapping`
:param package_dir: optional mapping of package names to directories.
the same format to :file:`setup.py` script's
``package_dir`` option
:type package_dir: :class:`collections.Mapping`
:type package_dir: :class:`collections.abc.Mapping`

.. versionchanged:: 0.4.0
It creates also source map files with filenames followed by
Expand Down