-
Notifications
You must be signed in to change notification settings - Fork 309
get rid of gittip.db global #1528
Comments
It is going to be a lot of work. Is it worth it? Do you have some other reason besides "it would look nicer"? |
@zwn Yeah, it'll take some work. Now is the time, though, with our focus on infrastructure. This will make our code easier to read and maintain, and it will make our test suite better. For example, right now Participant.get_giving_for_profile takes a db argument for testing purposes but we fall back to the global version. That's a mess. |
It also complicates sphinx build (see IRC). |
We have other global configuration but db is particularly egregious. |
What would be the best strategy to do this? Currently we have Is really the problem the existence of the I am asking because it relates to #1549. I'd like to wrap access to the db for that. |
Yes. :-(
configure-aspen.py is exec'd, not imported. Are you looking to import configure-aspen.py in another context, or ... ? |
Sphinx imports it. The |
What does Sphinx import?
@pjz and I talked this morning about making Aspen work more like you describe. For now there's an I feel like I'm not helping, though. Can you describe the immediate symptom you're dealing with? Sphinx doesn't like gittip.db? |
configure-aspen.py, actually it imports everything it finds.
Nothing immediate. Just wondering how it works in general and what should be the way forward with |
My half-formed intention has been to use it exclusively from |
@zwn Yes. Thanks. |
We configure a db instance of the gittip module. That's a turd. We shouldn't have global state like that. Instead we should pass around the db instance to the various classes and functions that want it.
The text was updated successfully, but these errors were encountered: