New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split up flask.py into multiple files #62
Comments
I'm fine with that, though once you do that it could be arguable whether Flask is a microframework anymore. On the other hand, it's arguable whether Flask is a microframework now, with the module support making it possible to write arbitrarily large applications. Still, I think Flask has taken a life of its own beyond its origins as an experiment in microframeworks and GitHub. If this makes it easier to make it more powerful in the future, I'm fine with that. (Though now you might need to make up another microframework for your series of blog posts on how to make a framework with Werkzeug. ^_^) |
I hope the definition of a microframework is not that it is stored in a single file :) |
regardless of the definition, i think this is a good idea for readability/edit-ability. im going to have a hack at this in my fork |
I'm no longer convinced that this is the way to go though. I can't think of anything else I want to add to Flask. Do you? |
not at the moment but im sure other functionality will crop up that you would want to add. in any case, having the file broken down makes reading and maintaining the codebase a little easier in my book. my rule of thumb is after 1K lines its time to break it up and currently flask.py is over 1.5K. If you are interested in taking a look, i have it working in my "module" branch and all unittests pass |
Yeah, as a framework, Flask has certainly built itself up to the point where it can stand on its own if there's an active community of extensioneers. (You should definitely use that word in the docs.) The only thing I can think of for 0.5 is being able to create additional exports of static files and reconfigure the template loader, because right now those are pretty hardwired into the core of Flask. If you could do that, it would be just about everything the extensioneers need to make everything else an extension. As for the issue of splitting into a package itself, I'm fine either way. I don't think Flask is too big for a single module (it's pushing it, though), but there are benefits to the package format - especially if it does grow more. |
Oh, and also doing something about issue #33 would be nice. |
I think I am considering pulling those changes. However I probably want to rearrange a few things. Are the changes from that branch up to date with the latest in my master? |
out on vacation for the 4th of july. ill pull your most recent changes into my fork and fix that json bug you raised then let you know next week |
I started a branch for that on my own now based on yours justquick. Same name: http://github.com/mitsuhiko/flask/tree/module |
Updated the branch. It now supports a static and template folders per module. |
Done. |
Flask gets more and more docstrings and inline documentation comments so that it becomes a quite large file. I would love to split this up for the next release into the following modules:
The text was updated successfully, but these errors were encountered: