# Path: axiom/iaxiom.py
# class IAxiomaticCommand(Interface):
#     """
#     Subcommand for 'axiomatic' and 'tell-axiom' command line programs.
# 
#     Should subclass twisted.python.usage.Options and provide a command to run.
# 
#     '.parent' attribute will be set to an object with a getStore method.
#     """
# 
#     name = Attribute("""
#     """)
# 
#     description = Attribute("""
#     """)


from zope.interface import alsoProvides, noLongerProvides
from twisted.plugin import IPlugin, getPlugins
from twisted.python import usage
from twisted.python.runtime import platform
from twisted.scripts import twistd
from axiom.iaxiom import IAxiomaticCommand
from six.moves import input
            from axiom import plugins
        from axiom.store import Store
import os
import sys
import glob
import errno
import signal
import six
import six
# -*- test-case-name: axiomatic.test.test_axiomatic -*-
from __future__ import print_function




class AxiomaticSubCommandMixin(object):
    store = property(lambda self: self.parent.getStore())

    def decodeCommandLine(self, cmdline):
        """
        Turn whatever type the command line was (possibly text in py3, possibly
        bytes in py2) into a text string.
        """
        if isinstance(cmdline, six.text_type):
            return cmdline
        codec = getattr(sys.stdin, 'encoding', None) or sys.getdefaultencoding()
        return six.text_type(cmdline, codec)



class _AxiomaticCommandMeta(type):
    """
    Metaclass for L{AxiomaticCommand}.

    This serves to make subclasses provide L{IPlugin} and L{IAxiomaticCommand}.
    """
    def __new__(cls, name, bases, attrs):
        newcls = type.__new__(cls, name, bases, attrs)

# Path: axiom/iaxiom.py
# class IAxiomaticCommand(Interface):
#     """
#     Subcommand for 'axiomatic' and 'tell-axiom' command line programs.
# 
#     Should subclass twisted.python.usage.Options and provide a command to run.
# 
#     '.parent' attribute will be set to an object with a getStore method.
#     """
# 
#     name = Attribute("""
#     """)
# 
#     description = Attribute("""
#     """)


# Path: axiom/scripts/axiomatic.py
from zope.interface import alsoProvides, noLongerProvides
from twisted.plugin import IPlugin, getPlugins
from twisted.python import usage
from twisted.python.runtime import platform
from twisted.scripts import twistd
from axiom.iaxiom import IAxiomaticCommand
from six.moves import input
            from axiom import plugins
        from axiom.store import Store
import os
import sys
import glob
import errno
import signal
import six
import six

# -*- test-case-name: axiomatic.test.test_axiomatic -*-
from __future__ import print_function




class AxiomaticSubCommandMixin(object):
    store = property(lambda self: self.parent.getStore())

    def decodeCommandLine(self, cmdline):
        """
        Turn whatever type the command line was (possibly text in py3, possibly
        bytes in py2) into a text string.
        """
        if isinstance(cmdline, six.text_type):
            return cmdline
        codec = getattr(sys.stdin, 'encoding', None) or sys.getdefaultencoding()
        return six.text_type(cmdline, codec)



class _AxiomaticCommandMeta(type):
    """
    Metaclass for L{AxiomaticCommand}.

    This serves to make subclasses provide L{IPlugin} and L{IAxiomaticCommand}.
    """
    def __new__(cls, name, bases, attrs):
        newcls = type.__new__(cls, name, bases, attrs)

        alsoProvides(newcls, IPlugin, IAxiomaticCommand)