SmartReceipt/py_graphite_reporter — pull request #2 by bcarl (2012-05-31 01:10:58+00:00)
Title: Fixes name clashes with socket module import.

This fixes an error that was attempted to be fixed in bcarl/py_graphite_reporter@1f303fba76692d6926a2f36b7b5c0efbeb2a2a18, but actually wasn't. The line `hostname = self.socket.gethostname()` was incorrect. It was actually also wrong prior to this commit, `hostname = socket.gethostname()`, because the socket module was not imported directly, but instead was imported as `from socket import socket`.

Importing the socket module separately now so we can use `socket.gethostname()` directly. Also changes the socket-creation calls to be fully-qualified as `socket.socket()`. Still importing socket constants as needed instead of referencing them by socket.CONST.