Giter Site home page Giter Site logo

marrow / webcore Goto Github PK

View Code? Open in Web Editor NEW
95.0 10.0 10.0 2.57 MB

WebCore, the super tiny and blazingly fast modular Python web nanoframework.

License: MIT License

Python 98.79% HTML 0.55% Makefile 0.66%
python web-framework micro-framework extensible modular wsgi pypi cpython pypy marrow

webcore's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webcore's Issues

Traversal dialect.

A thin layer on top of object dispatch to utilize a traversable model structure separate from the per-type associated controllers.

Switch to request-locals over thread-locals.

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.requestself._
  • web.core.responseself._.response
  • web.core.configself._.configuration
  • web.core.namespaceself._.namespace
  • web.core.cacheself._.cache
  • web.core.sessionself._.session
  • web.core.translatorself._.i18n

Overhaul templating and amend its documentation

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.

Switch to marrow.wsgi.objects over WebOb.

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.

i18n breaks serialization

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.

Allow the application to load data from database during initialization

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.

Create a light-weight template language plugin API.

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.

Alter core dispatch to include container references.

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.

Check/fix the examples

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.

Debugging Extension

We need a replacement for WebError. This replacement should have at least the following features:

  • Show highlighted traceback
  • Allow introspection in all involved stack frames
  • Integrate with cooperating template engines (such as Mako) to properly display the location of the error
  • Send highlighted tracebacks via email if so configured (using the mailer extension)
  • Propagate errors through the logging system (should be a given, but WebError didn't do this)

Bootstrap webapp.

A YAPWF webapp quickstart/bootstrap webapp allowing for interactive package and configuration creation.

YAPWF website.

Wiki base and should include mounted example applications (blog, IRC log, etc.).

Please add Python 2.4 Support

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. :-(

Optimized routing algorithm / dialect.

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.

Arkiva: IRC Archive

IRC log archive similar to Arkivo (written in TurboGears). Offers additional features and cleaner, more robust code.

i18n does not work if it's only used in templates

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.

Add "Routes" to setup.py tests_require (or install_requires?)

======================================================================
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

Add introspection to the XML-RPC dialect.

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:

  • listMethods — Recursively (preferably in flat loop) determine a list of all available methods.
  • methodSignature — Determine the acceptable argument combinations and return types.
  • methodHelp — Inspect and return a method's docstring.

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.

Global configuration is ignored

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.