schema_salad.sourceline
=======================

.. py:module:: schema_salad.sourceline


Attributes
----------

.. autoapisummary::

   schema_salad.sourceline.lineno_re


Classes
-------

.. autoapisummary::

   schema_salad.sourceline.SourceLine


Functions
---------

.. autoapisummary::

   schema_salad.sourceline.relname
   schema_salad.sourceline.add_lc_filename
   schema_salad.sourceline.reflow_all
   schema_salad.sourceline.reflow
   schema_salad.sourceline.indent
   schema_salad.sourceline.bullets
   schema_salad.sourceline.strip_duplicated_lineno
   schema_salad.sourceline.strip_dup_lineno
   schema_salad.sourceline.cmap


Module Contents
---------------

.. py:data:: lineno_re
   :type:  Final

.. py:function:: relname(source)

.. py:function:: add_lc_filename(r, source)

.. py:function:: reflow_all(text, maxline = None)

   Reflow text respecting a common prefix with line & col info.


.. py:function:: reflow(text, maxline, shift = '')

   Reflow a single line of text.


.. py:function:: indent(v, nolead = False, shift = '  ', bullet = '  ')

.. py:function:: bullets(textlist, bul)

   Indent using the specified number of bullets.


.. py:function:: strip_duplicated_lineno(text)

   Strip duplicated line numbers.

   Same as :py:meth:`strip_dup_lineno` but without reflow.


.. py:function:: strip_dup_lineno(text, maxline = None)

   Strip duplicated line numbers.


.. py:function:: cmap(d, lc = None, fn = None)

   Apply line+column & filename data through to the provided data.

   :param d: Target datastructure: number and strings will be passed through
             unchanged. Non-Commented container types with be transformed into
             the relevant Commented container types.
   :param lc: Line & Column information to be applied.
   :param fn: The Filename to store.
   :returns: The (transformed) datastructure.


.. py:class:: SourceLine(item, key = None, raise_type = str, include_traceback = False)

   .. py:attribute:: item


   .. py:attribute:: key
      :value: None



   .. py:attribute:: raise_type


   .. py:attribute:: include_traceback
      :value: False



   .. py:method:: __enter__()


   .. py:method:: __exit__(exc_type, exc_value, tb)


   .. py:method:: file()

      Return the embedded filename.



   .. py:method:: start()

      Determine the starting location.



   .. py:method:: end()

      Empty, for now.



   .. py:method:: makeLead()


   .. py:method:: makeError(msg)


