"""
Module to add streamparse-specific extensions to pystorm Component classes
"""
import pystorm
from pystorm.component import StormHandler  # This is used by other code

from ..dsl.component import ComponentSpec


class Component(pystorm.component.Component):
    """pystorm Component with streamparse-specific additions

    :ivar outputs: The outputs
    :ivar config: Component-specific config settings to pass to Storm.
    """
    outputs = None
    par = 1
    config = None

    @classmethod
    def spec(cls, name=None, inputs=None, par=None, config=None):
        """Create a :class:`~streamparse.dsl.component.ComponentSpec`.

        This spec represents this Component in a :class:`~streamparse.Topology`.

        :param name:   Name of this component.  Defaults to name of class.
        :type name:    `str`
        :param inputs: Streams that feed into this Component. Only makes sense
                       for :class:`~streamparse.Bolt`, as
                       :class:`~streamparse.Spout` instances do not receive
                       tuples.

                       Two forms of this are acceptable:

                       1.  A `dict` mapping from `ComponentSpec`s to tuple
                           groupings.
                       2.  A `list` of :class:`streamparse.Stream`s or
                           `ComponentSpec`s .
        :param par:    Parallelism hint for this Component.  For Python
                       Components, this works out to be the number of Python
                       processes running it in the the topology (across all
                       machines).  See :ref:`parallelism`.
        :type par:     `int`
        :param config: Component-specific config settings to pass to Storm.
        :type config:  `dict`
        """
        return ComponentSpec(cls, name=name, inputs=inputs, par=par,
                             config=config, outputs=cls.outputs)

@@ -169,51 +169,8 @@
 de%0A%0A
-from ..dsl.component import ComponentSpec%0A%0A
 %0Acla
@@ -473,1408 +473,229 @@
 ls, 
-name=None, inputs=None, par=None, config=None):%0A        %22%22%22Create a :class:%60~streamparse.dsl.component.ComponentSpec%60.%0A%0A        This spec represents this Component in a :class:%60~streamparse.Topology%60.%0A%0A        :param name:   Name of this component.  Defaults to name of class.%0A        :type name:    %60str%60%0A        :param inputs: Streams that feed into this Component. Only makes sense%0A                       for :class:%60~streamparse.Bolt%60, as%0A                       :class:%60~streamparse.Spout%60 instances do not receive%0A                       tuples.%0A%0A                       Two forms of this are acceptable:%0A%0A                       1.  A %60dict%60 mapping from %60ComponentSpec%60s to tuple%0A                           groupings.%0A                       2.  A %60list%60 of :class:%60streamparse.Stream%60s or%0A                           %60ComponentSpec%60s .%0A        :param par:    Parallelism hint for this Component.  For Python%0A                       Components, this works out to be the number of Python%0A                       processes running it in the the topology (across all%0A                       machines).  See :ref:%60parallelism%60.%0A        :type par:     %60int%60%0A        :param config: Component-specific config settings to pass to Storm.%0A        :type config:  %60dict%60%0A        %22%22%22%0A        return ComponentSpec(cls, name=name, inputs=inputs, par=par,%0A                             config=config, outputs=cls.outputs
+*args, **kwargs):%0A        %22%22%22This method exists only to give a more informative error message.%22%22%22%0A        raise TypeError('Specifications should either be bolts or spouts. '%0A                        'Given: %7B!r%7D'.format(cls)
 )%0A

Make Component.spec calls raise TypeError directly