Max00355/BlooCoin — pull request #17 by plausibility (2013-04-27 16:17:02+00:00)
Title: Cleanup, refactor, all round damn awesome updates to the client.

I went through the source, and did a few things that I thought were required.
__Note__, this is just for the client, the server will need plenty of work by itself.

I refactored a lot of the code because there was lots of duplicated socket work; now the heavy lifting is handled by `BlooCoin._send_json(self, data, buff)` which will push data down the tube to the server and receive back data of `buff` size. If the data is a dictionary, the appropriate `json.dumps()` call is done.

The creation of a new stamp was a bit over the top, since it was what; making a random string a few hundred times, then hashing and rehashing everything. Why?
Instead, I moved to `uuid.uuid4().hex`, then hashed that, because uuid is almost guaranteed randomness, so you're unlikely to run into a collision.

There are some other things I did, like almost complete PEP8 compliance, besides a few lines which are only slightly over the 79 character requirement.

So yes, check it out.