Exemple #1
0
    def as_docutils(
        self,
        configuration=None,
        output_directory=None,
    ):
        r'''Creates a docutils node representation of the output proxy.

        ::

            >>> for node in proxy.as_docutils():
            ...     print(node.pformat())
            ...
            <abjad_output_block image_layout_specifier image_render_specifier renderer="graphviz" xml:space="preserve">
                digraph G {
                    graph [bgcolor=transparent,
                        fontname=Arial,
                        penwidth=2,
                        truecolor=true];
                    node [fontname=Arial,
                        fontsize=12,
                        penwidth=2];
                    edge [penwidth=2];
                    node_0 [label="4/4",
                        shape=triangle];
                    node_1 [label="1/4",
                        shape=box];
                    node_2 [label="1/4",
                        shape=box];
                    node_3 [label="1/4",
                        shape=box];
                    node_4 [label="1/4",
                        shape=box];
                    subgraph cluster_cluster_offsets {
                        graph [style=rounded];
                        node_5_0 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 0 | <f_0_1> ++ }",
                            shape=Mrecord,
                            style=filled];
                        node_5_1 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 1/4 | <f_0_1> + }",
                            shape=Mrecord,
                            style=filled];
                        node_5_2 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 1/2 | <f_0_1> + }",
                            shape=Mrecord,
                            style=filled];
                        node_5_3 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 3/4 | <f_0_1> + }",
                            shape=Mrecord,
                            style=filled];
                        node_5_4 [label="{ <f_0_0> 1 | <f_0_1> ++ }",
                            shape=Mrecord];
                    }
                    node_0 -> node_1;
                    node_0 -> node_2;
                    node_0 -> node_3;
                    node_0 -> node_4;
                    node_1 -> node_5_0 [style=dotted];
                    node_1 -> node_5_1 [style=dotted];
                    node_2 -> node_5_1 [style=dotted];
                    node_2 -> node_5_2 [style=dotted];
                    node_3 -> node_5_2 [style=dotted];
                    node_3 -> node_5_3 [style=dotted];
                    node_4 -> node_5_3 [style=dotted];
                    node_4 -> node_5_4 [style=dotted];
                }
            <BLANKLINE>

        Returns list of docutils nodes.
        '''
        from abjad.tools import abjadbooktools
        result = []
        try:
            code = str(self.payload)
            if sys.version_info[0] == 2:
                code = code.decode('utf-8')
            node = abjadbooktools.abjad_output_block(code, code)
            node['image_layout_specifier'] = self.image_layout_specifier
            node['image_render_specifier'] = self.image_render_specifier
            node['renderer'] = 'graphviz'
            result.append(node)
        except UnicodeDecodeError:
            print()
            print(type(self))
            for line in code.splitlines():
                print(repr(line))
        return result
Exemple #2
0
    def as_docutils(
        self,
        configuration=None,
        output_directory=None,
        ):
        r'''Creates a docutils node representation of the output proxy.

        ::

            >>> for node in proxy.as_docutils():
            ...     print(node.pformat())
            ...
            <abjad_output_block image_layout_specifier image_render_specifier layout="dot" renderer="graphviz" xml:space="preserve">
                digraph G {
                    graph [bgcolor=transparent,
                        fontname=Arial,
                        penwidth=2,
                        truecolor=true];
                    node [fontname=Arial,
                        fontsize=12,
                        penwidth=2];
                    edge [penwidth=2];
                    node_0 [label="4/4",
                        shape=triangle];
                    node_1 [label="1/4",
                        shape=box];
                    node_2 [label="1/4",
                        shape=box];
                    node_3 [label="1/4",
                        shape=box];
                    node_4 [label="1/4",
                        shape=box];
                    subgraph cluster_cluster_offsets {
                        graph [style=rounded];
                        node_5_0 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 0 | <f_0_1> ++ }",
                            shape=Mrecord,
                            style=filled];
                        node_5_1 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 1/4 | <f_0_1> + }",
                            shape=Mrecord,
                            style=filled];
                        node_5_2 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 1/2 | <f_0_1> + }",
                            shape=Mrecord,
                            style=filled];
                        node_5_3 [color=white,
                            fillcolor=black,
                            fontcolor=white,
                            fontname="Arial bold",
                            label="{ <f_0_0> 3/4 | <f_0_1> + }",
                            shape=Mrecord,
                            style=filled];
                        node_5_4 [label="{ <f_0_0> 1 | <f_0_1> ++ }",
                            shape=Mrecord];
                    }
                    node_0 -> node_1;
                    node_0 -> node_2;
                    node_0 -> node_3;
                    node_0 -> node_4;
                    node_1 -> node_5_0 [style=dotted];
                    node_1 -> node_5_1 [style=dotted];
                    node_2 -> node_5_1 [style=dotted];
                    node_2 -> node_5_2 [style=dotted];
                    node_3 -> node_5_2 [style=dotted];
                    node_3 -> node_5_3 [style=dotted];
                    node_4 -> node_5_3 [style=dotted];
                    node_4 -> node_5_4 [style=dotted];
                }
            <BLANKLINE>

        Returns list of docutils nodes.
        '''
        from abjad.tools import abjadbooktools
        result = []
        try:
            code = str(self.payload)
            if sys.version_info[0] == 2:
                code = code.decode('utf-8')
            node = abjadbooktools.abjad_output_block(code, code)
            node['image_layout_specifier'] = self.image_layout_specifier
            node['image_render_specifier'] = self.image_render_specifier
            node['layout'] = self.layout
            node['renderer'] = 'graphviz'
            result.append(node)
        except UnicodeDecodeError:
            print()
            print(type(self))
            for line in code.splitlines():
                print(repr(line))
        return result
    def as_docutils(
        self,
        configuration=None,
        output_directory=None,
        ):
        r'''Creates a docutils node representation of the output proxy.

        ::

            >>> for node in proxy.as_docutils():
            ...     print(node.pformat())
            ...
            <abjad_output_block renderer="lilypond" xml:space="preserve">
                \version "2.19.0"
                \language "english"
            <BLANKLINE>
                #(set-global-staff-size 12)
            <BLANKLINE>
                \header {
                    tagline = \markup {}
                }
            <BLANKLINE>
                \layout {
                    indent = #0
                    ragged-right = ##t
                    \context {
                        \Score
                        \remove Bar_number_engraver
                        \override SpacingSpanner #'strict-grace-spacing = ##t
                        \override SpacingSpanner #'strict-note-spacing = ##t
                        \override SpacingSpanner #'uniform-stretching = ##t
                        \override TupletBracket #'bracket-visibility = ##t
                        \override TupletBracket #'minimum-length = #3
                        \override TupletBracket #'padding = #2
                        \override TupletBracket #'springs-and-rods = #ly:spanner::set-spacing-rods
                        \override TupletNumber #'text = #tuplet-number::calc-fraction-text
                        proportionalNotationDuration = #(ly:make-moment 1 24)
                        tupletFullLength = ##t
                    }
                }
            <BLANKLINE>
                \paper {
                    left-margin = 1\in
                }
            <BLANKLINE>
                \score {
                    \new Staff {
                        c'4
                        d'4
                        e'4
                        f'4
                    }
                }
            <BLANKLINE>

        Returns list of docutils nodes.
        '''
        from abjad.tools import abjadbooktools
        result = []
        try:
            code = format(self.payload)
            if sys.version_info[0] == 2:
                code = code.decode('utf-8')
            node = abjadbooktools.abjad_output_block(code, code)
            if self.pages is not None:
                node['pages'] = self.pages
            node['renderer'] = 'lilypond'
            result.append(node)
        except UnicodeDecodeError:
            print()
            print(type(self))
            for line in code.splitlines():
                print(repr(line))
        return result
    def as_docutils(
        self,
        configuration=None,
        output_directory=None,
    ):
        r'''Creates a docutils node representation of the output proxy.

        ::

            >>> for node in proxy.as_docutils():
            ...     print(node.pformat())
            ...
            <abjad_output_block image_layout_specifier image_render_specifier renderer="lilypond" xml:space="preserve">
                \version "2.19.0"
                \language "english"
            <BLANKLINE>
                #(set-global-staff-size 12)
            <BLANKLINE>
                \header {
                    tagline = \markup {}
                }
            <BLANKLINE>
                \layout {
                    indent = #0
                    ragged-right = ##t
                    \context {
                        \Score
                        \remove Bar_number_engraver
                        \override SpacingSpanner #'strict-grace-spacing = ##t
                        \override SpacingSpanner #'strict-note-spacing = ##t
                        \override SpacingSpanner #'uniform-stretching = ##t
                        \override TupletBracket #'bracket-visibility = ##t
                        \override TupletBracket #'minimum-length = #3
                        \override TupletBracket #'padding = #2
                        \override TupletBracket #'springs-and-rods = #ly:spanner::set-spacing-rods
                        \override TupletNumber #'text = #tuplet-number::calc-fraction-text
                        proportionalNotationDuration = #(ly:make-moment 1 24)
                        tupletFullLength = ##t
                    }
                }
            <BLANKLINE>
                \paper {
                    left-margin = 1\in
                }
            <BLANKLINE>
                \score {
                    \new Staff {
                        c'4
                        d'4
                        e'4
                        f'4
                    }
                }
            <BLANKLINE>

        Returns list of docutils nodes.
        '''
        from abjad.tools import abjadbooktools
        result = []
        try:
            code = format(self.payload)
            if sys.version_info[0] == 2:
                code = code.decode('utf-8')
            node = abjadbooktools.abjad_output_block(code, code)
            node['image_layout_specifier'] = self.image_layout_specifier
            node['image_render_specifier'] = self.image_render_specifier
            node['renderer'] = 'lilypond'
            result.append(node)
        except UnicodeDecodeError:
            print()
            print(type(self))
            for line in code.splitlines():
                print(repr(line))
        return result