marrow / webcore Goto Github PK
View Code? Open in Web Editor NEWWebCore, the super tiny and blazingly fast modular Python web nanoframework.
License: MIT License
WebCore, the super tiny and blazingly fast modular Python web nanoframework.
License: MIT License
A thin layer on top of object dispatch to utilize a traversable model structure separate from the per-type associated controllers.
Request-locals are attached to controller instances as the self._
attribute and represents (by itself) the request. Additional sub-attributes represent other key objects:
web.core.request
➙ self._
web.core.response
➙ self._.response
web.core.config
➙ self._.configuration
web.core.namespace
➙ self._.namespace
web.core.cache
➙ self._.cache
web.core.session
➙ self._.session
web.core.translator
➙ self._.i18n
To alleviate "MySQL has gone away" issues, reduce pool_recycle to 3600 seconds (one hour) to force SQLAlchemy to re-connect before MySQL's timeout.
web.widgets = tw2?
Complete installation instructions need to be written.
E.g.: http://wiki.github.com/GothAlice/TurboMail-Lists/installing-turbomail-lists
Users will want to render templates directly from controllers, for emails and such. Therefore the documentation should explain how to use TemplateInterface directly. The render() callable should be updated to add the WebCore globals used by the TemplateMiddleware. The old Buffet compatibility code should be removed as it is untested and nobody is apparently using it.
Specifically mentioned in IRC are compound single line statements, e.g.
if template not in self.cache: self.cache[template] = tmpl
XML-RPC calls should avoid returning HTTP error codes whenever possible. Exceptions should be handled by the dispatcher and turned into proper XML-RPC Faults. There appears to be one widely-accepted specification for error codes for such situations: http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php
Create new package, WebCore-Syndication
, to offer a unified RSS/Atom interface and support for extensible standards (such as Media-RSS).
This will involve getting marrow.wsgi.objects into a more complete state (likely as required by WebCore) and make it PEP 3333-compliant, which it almost already is.
When i18n is enabled, WebCore adds the "i18n" option to keyword arguments passed to the engine. Alacarte then happily forwards all those to $X.dumps() which of course don't understand such an option, basically causing all serialization engines to fail.
This often comes up and there is no good way to do this currently. The ONLY way seems to be to hook into the populate() function in each model module. There needs to be a better way. Preferably setting the thread-local sessions for all models during the initialization of the root controller.
Unit tests should also test passing of complex objects and exception handling.
Buffet is horribly complicated, and not supported natively by a large number of templating languages. Patches should be submitted to upstream template language developers to add support for a better common API.
On each transition between classes (e.g. non-method attributes, __lookup__
result, etc.) update the parent
attribute of the current context (self._
in other tickets; actual name under debate) to reference the containing controller.
In this way it is not necessary to explicitly pass your parent controller to the sub-controller's initializer, which adds code complexity and hinders readability. E.g. instead of having a complex __init__
to create instances dynamically or passing references to self when creating instances in a __lookup__
method.
This does not effect the handling of __lookup__
as it will continue to return a class instance and remaining dispatch path, with the requirement that the instance is created during execution of __lookup__
.
Ming is a MongoDB layer that adds support for schema validation and migration.
See: http://blog.pythonisito.com/2009/12/ming-01-released-python-library-for.html http://merciless.sourceforge.net/ and http://pypi.python.org/pypi/Ming
Add additional sections for tutorials and reference (auto-generated API docs).
Specs are here: http://xmlrpc-c.sourceforge.net/introspection.html
Consider the possibility to parse argument and return value types from docstrings (or later from py3k annotations).
One other option is to use a decorator to add such type data.
Writing unit tests I was unable to get a unicode body response from my code (the core application layer returns a list, as per WSGI spec) or from Genshi (despite setting both implicitly and explicitly the encoding to None).
I'd like to specify my own handlers (Controller) for different errors (404, 500 etc).
Many examples don't work because they are lacking the proper Beaker configuration (lock_dir, data_dir).
Test every example and make sure they work as intended. Cut out all the unnecessary configuration from the ini files.
We need a replacement for WebError. This replacement should have at least the following features:
Using WebTest perhaps?
A YAPWF webapp quickstart/bootstrap webapp allowing for interactive package and configuration creation.
The tutorial is complicated enough to scare even me. Rewrite it in a manner more approachable to newbies.
I think you can just look at web/core/i18n.py lines 305-> to see why this is broken.
There should be some way to generate URLs relative to the application root.
Perhaps with paste's PrefixMiddleware or similar approach?
Wiki base and should include mounted example applications (blog, IRC log, etc.).
Please add Python 2.4 support. One of the more popular Enterprise distros, RHEL (or CentOS) only ships with Python 2.4 and this precludes the ability to even try out WebCore on that distro. :-(
This will likely involve metaclasses and an update to the Dialect's init to assign properties. To handle dynamic attachment a setattr will need to be created as well.
If this can be done with current WebCore, I don't know how. Implement and document this.
Write up an explicit routing system (a la Routes) that does not suck. Utilize a static + regular expression tree (stored in a list of tuples most likely) for optimum tree descent searches. For details see the Explicit Routing section of the WebCore website.
IRC log archive similar to Arkivo (written in TurboGears). Offers additional features and cleaner, more robust code.
The i18n middleware relies on it being imported somewhere during root controller lookup. Otherwise it won't initialize even when web.i18n = True. This should be fixed by moving the initializer to web.core.middleware.
======================================================================
ERROR: Failure: ImportError (No module named routes.mapper)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/aatiis/work/pvenv/2.5/lib64/python2.5/site-packages/nose/loader.py", line 382, in loadTestsFromName
addr.filename, addr.module)
File "/home/aatiis/work/pvenv/2.5/lib64/python2.5/site-packages/nose/importer.py", line 39, in importFromPath
return self.importFromDir(dir_path, fqname)
File "/home/aatiis/work/pvenv/2.5/lib64/python2.5/site-packages/nose/importer.py", line 86, in importFromDir
mod = load_module(part_fqname, fh, filename, desc)
File "/home/aatiis/work/pvenv/2.5/src/WebCore/tests/test_routes.py", line 6, in <module>
from web.core.dialects.routing import RoutingController
File "/home/aatiis/work/pvenv/2.5/src/WebCore/web/core/dialects/routing.py", line 4, in <module>
from routes.mapper import Mapper
ImportError: No module named routes.mapper
Similar to JSON or Bencoding with a big difference, YAML offers rich encoding of machine data in a human-parsable format.
Extensions will work even in the post-setuptools ecosystem, and they're compatible with setuptools entrypoints.
More at http://pypi.python.org/pypi/extensions/0.4
Currently the XML-RPC dialect makes no assumptions about the input or output values. An additional class should be made available (SystemXMLRPCController) which contains the following three methods:
Having it as a separate class avoids adding it indiscriminately to all nested classes (which would be bad) and allows for its optional use as needed. (Introspection may be a security risk.)
Additionally, signatures should be enforced. E.g. calling a 'math.multiply' method with a string and a number (without signature checking) would result in a repeated string, not numeric multiplication.
I was wondering why nothing that I specify in my ini's [default] section is applied to the configuration, and I tracked the problem to web.core.application.Application.factory. When the web.core.config variable is initialized, it ignores the global configuration.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.