reddit/reddit — pull request #520 by kkress (2012-09-08 05:41:13+00:00)
Title: Import cleanup

Round 1: Fight

* start the import cleanups with model. This puts model in the state it should be.
* Remove all ```from r2.model import *```
* Fix up any modules that used ```from r2.model import *``` to make sure they weren't relying on an implicit import
* This does not yet include support for ```__all__``` @decorator, but that will come later.
* Split builder.py into 2 files, builder.py contains the ```Builder``` base class and builders.py contains all the sub-classes. This was required to resolve ```Account``` and ```Subreddit``` circular dependencies.
* Tested every import and removed any that were not needed for that file.
* I have not yet touched function level imports. Those will be a separate change since those are likely to be a bit trickier dependency-wise.

Bonuses:

* delete duplicate ```tup``` defintion
* Added a pylintrc with some of reddit's coding standards (based on @kemitche's)
* Any file touched has had its imports cleaned up a bit, removing any import *'s and relative import paths.
* scraper.py now doesn't choke pylint (yes @spladug is going to get rid of it shortly, but I already modified it for import changes) this was done by removing the ```+``` at the end of each line, which was choking the parser for pylint

NOTES:

* reddit_base.py : In ```MinimalController.post()``` near "update last_visit" there is a variable ```path_info``` that doesn't exist. I couldn't easily figure out what it should be from context, so I left it alone

* ```template_helpers.py``` : There is a reference to non-existent class ```OrganicListing```. This is one of about 5 I found, though i see no trace of that class. private maybe?

* r2/controllers/ipn.py : ```verify_ipn()``` : Fixed the use of parameters, please verify this is correct

* r2/controllers/promotecontroller.py : Fixed and issue in ```POST_edit_promo()```, that call near the end to :

```if getattr(link, "domain_override", False) or domain_override:```

Should be:

```if getattr(l, "domain_override", False) or domain_override:```

Please verify

Testing Done:
* pylint on all changed files
* general poking at the site to ensure it worked as expected. Is there a script I can follow to ensure nothing is borked?