Commits

Lynn Rees  committed f1d0ddb

- change import path

  • Participants
  • Parent commits db9f5b4
  • Branches pu

Comments (0)

Files changed (21)

File wire/talk/bencodew.py

 except ImportError:
     raise ImportError('requires "BitTorrent-bencode" library')
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KBencodeDumps
 from wire.keys.untalk import KBencodeLoads
 

File wire/talk/bsonw.py

 except ImportError:
     raise ImportError('requires "bson" library')
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KBSONDumps
 from wire.keys.untalk import KBSONLoads
 

File wire/talk/csvw.py

 # pylint: enable-msg=f0401
 from appspace.keys import appifies
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KCSVDumps
 from wire.keys.untalk import KCSVLoads
 

File wire/talk/excelw.py

 from six.moves import StringIO, range  # @UnresolvedImport
 # pylint: enable-msg=f0401
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KExcelDumps
 from wire.keys.untalk import KExcelLoads
 

File wire/talk/htmlw.py

 except ImportError:
     raise ImportError('requires "lxml" library')
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KHTMLDumps
 from wire.keys.untalk import KHTMLLoads
 

File wire/talk/jsonpicklew.py

 from appspace.keys import appifies
 from jsonpickle import decode, encode
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KJSONDumps
 from wire.keys.untalk import KJSONLoads
 

File wire/talk/jsonw.py

 from omnijson import dumps, loads
 from appspace.keys import appifies
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KJSONDumps
 from wire.keys.untalk import KJSONLoads
 

File wire/talk/marshalw.py

 
 from appspace.keys import appifies
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KMarshalDumps
 from wire.keys.untalk import KMarshalLoads
 

File wire/talk/msgpackw.py

 import msgpack
 from appspace.keys import appifies
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KMessagePackDumps
 from wire.keys.untalk import KMessagePackLoads
 

File wire/talk/multipartw.py

 from appspace.keys import appifies
 from urllib3.filepost import encode_multipart_formdata
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KMultiPartDumps
 from wire.keys.untalk import KMultiPartLoads
 

File wire/talk/netstringw.py

 from appspace.keys import appifies
 from netstring import encode, decode
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KNetStringDumps
 from wire.keys.untalk import KNetStringLoads
 

File wire/talk/picklew.py

 from stuf.six.moves import cPickle as pickle  # @UnresolvedImport
 # pylint: enable-msg=f0401
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KPickleDumps
 from wire.keys.untalk import KPickleLoads
 

File wire/talk/plistw.py

 from six.moves import read_plist, write_plist  # @UnresolvedImport
 # pylint: enable-msg=f0401
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KPlistDumps
 from wire.keys.untalk import KPlistLoads
 

File wire/talk/protobufw.py

 
 from appspace.keys import appifies
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KProtobufDumps
 from wire.keys.untalk import KProtobufLoads
 

File wire/talk/talklet.py

+# -*- coding: utf-8 -*-
+'''wire talklet'''
+
+from callchain import ResetLocalMixin
+from callchain.chain import ChainletQ
+from twoq.lazy.mixins import AutoQMixin
+
+
+class Package(ResetLocalMixin):
+
+    '''data package'''
+
+    def __init__(self, data, mime, charset=None):
+        super(Package, self).__init__()
+        self.data = data
+        self.mime = mime
+        self.charset = charset
+
+
+class talklet(ChainletQ, AutoQMixin):
+
+    '''talklet mixin'''
+
+    type = 'application/x-www-form-urlencoded'
+    charset = None
+
+    def _encode(self, data):
+        return Package(data, self.mime, self.charset)
+
+    def _process(self, encoder):
+        with self._sync as sync:
+            _encode = self._encode
+            sync(_encode(encoder(d)) for d in sync.iterable)
+        return self

File wire/talk/thriftw.py

 except ImportError:
     raise ImportError('requires "thrift" library')
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KThriftDumps
 from wire.keys.untalk import KThriftLoads
 

File wire/talk/tnetstringw.py

 from appspace.keys import appifies
 from tnetstring import dumps, loads
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KTNetStringDumps
 from wire.keys.untalk import KTNetStringLoads
 

File wire/talk/urlw.py

 from stuf.six.moves import parse_qs, urlencode  # @UnresolvedImport
 # pylint: enable-msg=f0401
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KURLEncodeDumps
 from wire.keys.untalk import KURLEncodeLoads
 

File wire/talk/xmlrpcw.py

 from six.moves import xmlrpc  # @UnresolvedImport
 # pylint: enable-msg=f0401,e0611
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KXMLRPCDumps
 from wire.keys.untalk import KXMLRPCLoads
 

File wire/talk/xmlw.py

 except ImportError:
     from xml.etree.ElementTree import tostring, fromstring
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KXMLDumps
 from wire.keys.untalk import KXMLLoads
 

File wire/talk/yamlw.py

 except ImportError:
     raise ImportError('requires PyYaml module')
 
-from wire.datalet import talklet
+from wire.talk.talklet import talklet
 from wire.keys.talk import KYaMLDumps
 from wire.keys.untalk import KYaMLLoads