Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
add __all__ to all modules. fixes #141
Browse files Browse the repository at this point in the history
  • Loading branch information
emmettbutler committed Apr 24, 2015
1 parent 98d6544 commit 25a22f1
Show file tree
Hide file tree
Showing 19 changed files with 32 additions and 9 deletions.
3 changes: 3 additions & 0 deletions pykafka/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
from topic import Topic
from client import KafkaClient
from balancedconsumer import BalancedConsumer

__all__ = ["Broker", "SimpleConsumer", "Cluster", "Partition", "Producer",
"Topic", "KafkaClient", "BalancedConsumer"]
1 change: 1 addition & 0 deletions pykafka/balancedconsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__all__ = ["BalancedConsumer"]
import itertools
import logging as log
import socket
Expand Down
2 changes: 2 additions & 0 deletions pykafka/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__all__ = ["BaseCluster", "BaseBroker", "BasePartition", "BaseTopic",
"BaseSimpleConsumer", "BaseProducer", "BaseAsyncProducer"]
from common import CompressionType
from partitioners import random_partitioner

Expand Down
1 change: 1 addition & 0 deletions pykafka/broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__all__ = ["Broker"]
import logging
import time

Expand Down
1 change: 1 addition & 0 deletions pykafka/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
limitations under the License.
"""

__all__ = ["KafkaClient"]
import handlers
import logging
from cluster import Cluster
Expand Down
2 changes: 1 addition & 1 deletion pykafka/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["Cluster"]
import logging
import random
import time
Expand Down
2 changes: 1 addition & 1 deletion pykafka/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["Message", "CompressionType", "OffsetType"]
import logging


Expand Down
2 changes: 1 addition & 1 deletion pykafka/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["BrokerConnection"]
import logging
import socket
import struct
Expand Down
2 changes: 1 addition & 1 deletion pykafka/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["ResponseFuture", "Handler", "ThreadingHandler", "RequestHandler"]
import atexit
import threading
import Queue
Expand Down
1 change: 1 addition & 0 deletions pykafka/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__all__ = ["Partition"]
import logging

import base
Expand Down
3 changes: 2 additions & 1 deletion pykafka/partitioners.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["random_partitioner", "BasePartitioner", "HashingPartitioner",
"hashing_partitioner"]
import random


Expand Down
2 changes: 1 addition & 1 deletion pykafka/producer.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["Producer", "AsyncProducer"]
import itertools
import logging
import time
Expand Down
10 changes: 10 additions & 0 deletions pykafka/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@
  CorrelationId => int32
  ResponseMessage => MetadataResponse | ProduceResponse | FetchResponse | OffsetResponse | OffsetCommitResponse | OffsetFetchResponse
"""
__all__ = [
"MetadataRequest", "MetadataResponse", "ProduceRequest", "ProduceResponse",
"OffsetRequest", "OffsetResponse", "OffsetCommitRequest",
"FetchRequest", "FetchResponse", "PartitionFetchRequest",
"OffsetCommitResponse", "OffsetFetchRequest", "OffsetFetchResponse",
"PartitionOffsetRequest", "ConsumerMetadataRequest",
"ConsumerMetadataResponse", "PartitionOffsetCommitRequest",
"PartitionOffsetFetchRequest",
"Request", "Response", "Message", "MessageSet"
]
import itertools
import logging
import struct
Expand Down
1 change: 1 addition & 0 deletions pykafka/simpleconsumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__all__ = ["SimpleConsumer"]
import itertools
import logging as log
import time
Expand Down
1 change: 1 addition & 0 deletions pykafka/topic.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__all__ = ["Topic"]
import logging
import weakref
from collections import defaultdict
Expand Down
2 changes: 1 addition & 1 deletion pykafka/utils/compression.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["encode_gzip", "decode_gzip", "encode_snappy", "decode_snappy"]
import gzip
import logging

Expand Down
1 change: 1 addition & 0 deletions pykafka/utils/error_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
__all__ = ["handle_partition_responses", "raise_error"]
from collections import defaultdict


Expand Down
2 changes: 1 addition & 1 deletion pykafka/utils/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["recvall_into"]
from pykafka.exceptions import SocketDisconnectedError


Expand Down
2 changes: 1 addition & 1 deletion pykafka/utils/struct_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
"""

__all__ = ["unpack_from"]
import itertools
import struct

Expand Down

0 comments on commit 25a22f1

Please sign in to comment.