Пример #1
0
    def make_autoeditable_class_selector(self):
        r'''Makes autoeditable class selector.

        Returns selector.
        '''
        from abjad.tools import handlertools
        classes = set()
        for class_ in documentationtools.list_all_abjad_classes():
            if hasattr(class_, '_attribute_manifest'):
                classes.add(class_)
        modules = (handlertools,)
        for class_ in documentationtools.list_all_experimental_classes(
            modules=modules):
            if hasattr(class_, '_attribute_manifest'):
                classes.add(class_)
        if self._session._ide is not None:
            wrangler = self._session._ide._maker_file_wrangler
            maker_classes = wrangler._list_maker_classes()
            for class_ in maker_classes:
                if hasattr(class_, '_attribute_manifest'):
                    classes.add(class_)
        classes.add(list)
        classes = sorted(classes, key=lambda x: x.__name__)
        selector = type(self)(
            session=self._session,
            items=classes,
            breadcrumb='autoeditable class',
            )
        return selector
Пример #2
0
    abjad.book.ImageOutputProxy,
    abjad.book.LaTeXDocumentHandler,
    abjad.book.LilyPondBlock,
    abjad.book.SphinxDocumentHandler,
    abjad.Enumeration,
    lilypondparsertools.LilyPondLexicalDefinition,
    lilypondparsertools.LilyPondSyntacticalDefinition,
    lilypondparsertools.ReducedLyParser,
    lilypondparsertools.SchemeParser,
    rhythmtreetools.RhythmTreeParser,
    abjad.StorageFormatManager,
    abjad.FormatSpecification,
    abjad.TestCase,
)

classes = documentationtools.list_all_abjad_classes(
    ignored_classes=ignored_classes, )


@pytest.mark.parametrize('class_', classes)
def test_abjad___doc___01(class_):
    r'''All classes have a docstring. All class methods have a docstring.
    '''
    missing_doc_names = []
    if class_.__doc__ is None:
        missing_doc_names.append(class_.__name__)
    for attribute in inspect.classify_class_attrs(class_):
        if attribute.name in ignored_names:
            continue
        elif attribute.defining_class is not class_:
            continue
        if attribute.name[0].isalpha() or attribute.name.startswith('__'):
Пример #3
0
# -*- encoding: utf-8 -*-
import inspect
import pytest
import abjad
from abjad.tools import documentationtools
from abjad.tools import metertools
from abjad.tools import tonalanalysistools


classes = documentationtools.list_all_abjad_classes()
@pytest.mark.parametrize('class_', classes)
def test_abjad___format___01(class_):
    r'''All concrete classes have a storage format.
    '''

    if '_storage_format_specification' in dir(class_) and \
        not inspect.isabstract(class_):
        instance = class_()
        instance_format = format(instance, 'storage')
        assert isinstance(instance_format, str)
        assert not instance_format == ''


# TODO: make these work eventually
_classes_to_temporarily_skip = (
    metertools.Meter,
    tonalanalysistools.RootedChordClass,
    )

classes = documentationtools.list_all_abjad_classes()
@pytest.mark.parametrize('class_', classes)
Пример #4
0
# -*- encoding: utf-8 -*-
import inspect
import pytest
import abjad
from abjad.tools import documentationtools
from abjad.tools import metertools
from abjad.tools import tonalanalysistools

classes = documentationtools.list_all_abjad_classes()


@pytest.mark.parametrize('class_', classes)
def test_abjad___format___01(class_):
    r'''All concrete classes have a storage format.
    '''

    if '_storage_format_specification' in dir(class_) and \
        not inspect.isabstract(class_):
        instance = class_()
        instance_format = format(instance, 'storage')
        assert isinstance(instance_format, str)
        assert not instance_format == ''


# TODO: make these work eventually
_classes_to_temporarily_skip = (
    metertools.Meter,
    tonalanalysistools.RootedChordClass,
)

classes = documentationtools.list_all_abjad_classes()
Пример #5
0
# -*- encoding: utf-8 -*-
import inspect
import pytest
from abjad.tools import documentationtools


ignored_classes = (
    )

classes = documentationtools.list_all_abjad_classes(
    ignored_classes=ignored_classes,
    )


@pytest.mark.parametrize('class_', classes)
def test_abjad___rmul___01(class_):
    r'''All classes implementing __mul__ also implement __rmul__.
    '''
    if inspect.isabstract(class_):
        return
    if hasattr(class_, '__mul__'):
        assert hasattr(class_, '__rmul__')