Source

callchain / callchain / chainlet / keys.py

# -*- coding: utf-8 -*-
'''callchain contrib keys'''

from appspace import Attribute, AppLookupError

from callchain.key.mixin import KBranch


class NoService(AppLookupError):

    '''no service'''


class KChainlet(KBranch):

    '''service key'''

    def back():  # @NoSelf
        '''switch back to root chain'''


class KLogger(KChainlet):

    '''logging service key'''

    logger = Attribute('the logger')

    def debug(msg):  # @NoSelf
        '''log debug message'''

    def warning(msg):  # @NoSelf
        '''log warning message'''

    def info(msg):  # @NoSelf
        '''log info message'''

    def error(msg):  # @NoSelf
        '''log error message'''

    def critical(msg):  # @NoSelf
        '''log critical message'''

    def exception(msg):  # @NoSelf
        '''log exception message'''


class KIO(KChainlet):

    def read(mode='rb', encoding=None, errors='strict', *paths):  # @NoSelf
        '''
        read incoming things from files

        @param mode: mode to open files (default: 'r')
        @param encoding: encoding for text data (default: `None`)
        @param errors: error handling in encoding text data (default: 'strict')
        @param *paths: sequence of filesystem paths
        '''

    def write(mode='rb', encoding=None, errors='strict', *paths):  # @NoSelf
        '''
        write outgoing things to files

        @param mode: mode to open files (default: 'r')
        @param encoding: encoding for text data (default: `None`)
        @param errors: error handling in encoding text data (default: 'strict')
        @param *paths: sequence of filesystem paths
        '''


class KDumps(KChainlet):

    '''dumping key'''

    def protobuf():  # @NoSelf
        '''
        google protocol buffers dumps

        http://code.google.com/p/protobuf/

        http://pypi.python.org/pypi/protobuf/
        '''

    def thrift():  # @NoSelf
        '''
        thrift dumps

        http://thrift.apache.org/

        http://pypi.python.org/pypi/thrift/
        '''

    def bencode():  # @NoSelf
        '''
        bencode dumps

        http://en.wikipedia.org/wiki/Bencode

        http://pypi.python.org/pypi/BitTorrent-bencode/
        '''

    def bson():  # @NoSelf
        '''
        binary JSON dumps

        http://en.wikipedia.org/wiki/BSON

        http://pypi.python.org/pypi/bson/0.3.3
        '''

    def csv(**kw):  # @NoSelf
        '''csv serialization'''

    def excel(**kw):  # @NoSelf
        '''
        M$ excel dumps

        http://pypi.python.org/pypi/xlrd/

        http://pypi.python.org/pypi/xlwt/
        '''

    def html(**kw):  # @NoSelf
        '''
        html dumps

        http://pypi.python.org/pypi/lxml/
        '''

    def json(**kw):  # @NoSelf
        '''JavaScript Object Notation (JSON) dumps'''

    def jsonpickle():  # @NoSelf
        '''JavaScript Object Notation (JSON) pickle dumps'''

    def marshal():  # @NoSelf
        '''Python marshal dumps'''

    def message_pack(**kw):  # @NoSelf
        '''
        message pack dumps

        http://msgpack.org/

        http://pypi.python.org/pypi/msgpack-python/
        '''

    def multipart():  # @NoSelf
        '''form-multipart serialization'''

    def netstring(**kw):  # @NoSelf
        '''
        netstring dumps

        http://cr.yp.to/proto/netstrings.txt

        http://pypi.python.org/pypi/netstring
        '''

    def pickle():  # @NoSelf
        '''python pickle dumps'''

    def plist():  # @NoSelf
        '''property list dumps'''

    def tnetstring():  # @NoSelf
        '''
        tnetstring dumps

        http://pypi.python.org/pypi/tnetstring/
        '''

    def urlencode(**kw):  # @NoSelf
        '''urlencode serialization'''

    def xml(**kw):  # @NoSelf
        '''eXtensible markup language dumps'''

    def xmlrpc(**kw):  # @NoSelf
        '''
        eXtensible markup language remote procedure call dumps
        '''

    def yaml(**kw):  # @NoSelf
        '''
        YaML ain't markup language dumps

        http://en.wikipedia.org/wiki/YAML

        http://pypi.python.org/pypi/PyYAML/
        '''


class KLoads(KChainlet):

    '''loading key'''

    def protobuf(**kw):  # @NoSelf
        '''
        google protocol buffers loading

        http://code.google.com/p/protobuf/

        http://pypi.python.org/pypi/protobuf/
        '''

    def thrift(base):  # @NoSelf
        '''
        thrift loading

        http://thrift.apache.org/

        http://pypi.python.org/pypi/thrift/
        '''

    def bencode():  # @NoSelf
        '''
        bencode loading

        http://en.wikipedia.org/wiki/Bencode

        http://pypi.python.org/pypi/BitTorrent-bencode/
        '''

    def bson():  # @NoSelf
        '''
        binary JavaScript Object Notation loading

        http://en.wikipedia.org/wiki/BSON

        http://pypi.python.org/pypi/bson/0.3.3
        '''

    def csv(**kw):  # @NoSelf
        '''csv serialization'''

    def excel(**kw):  # @NoSelf
        '''
        M$ excel loading

        http://pypi.python.org/pypi/xlrd/

        http://pypi.python.org/pypi/xlwt/
        '''

    def html(**kw):  # @NoSelf
        '''
        html loading

        http://pypi.python.org/pypi/lxml/
        '''

    def json(**kw):  # @NoSelf
        '''JavaScript Object Notation (JSON) loading'''

    def jsonpickle():  # @NoSelf
        '''JavaScript Object Notation (JSON) pickle loading'''

    def marshal():  # @NoSelf
        '''Python marshal loading'''

    def message_pack(**kw):  # @NoSelf
        '''
        message pack loading

        http://msgpack.org/

        http://pypi.python.org/pypi/msgpack-python/
        '''

    def multipart():  # @NoSelf
        '''form-multipart serialization'''

    def netstring(**kw):  # @NoSelf
        '''
        netstring loading

        http://cr.yp.to/proto/netstrings.txt

        http://pypi.python.org/pypi/netstring
        '''

    def pickle():  # @NoSelf
        '''python pickle loading'''

    def plist():  # @NoSelf
        '''property list loading'''

    def tnetstring():  # @NoSelf
        '''
        tnetstring loading

        http://pypi.python.org/pypi/tnetstring/
        '''

    def urlencode(**kw):  # @NoSelf
        '''urlencode serialization'''

    def xml(**kw):  # @NoSelf
        '''eXtensible markup language loading'''

    def xmlrpc(**kw):  # @NoSelf
        '''
        eXtensible markup language remote procedure call loading
        '''

    def yaml(**kw):  # @NoSelf
        '''
        YaML ain't markup language loading

        http://en.wikipedia.org/wiki/YAML

        http://pypi.python.org/pypi/PyYAML/
        '''
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.