Quantcast
Channel: User Armin Ronacher - Stack Overflow
Browsing all 43 articles
Browse latest View live
↧

Answer by Armin Ronacher for Is there a way to make Flask more verbose?

Error handling is off by default in production mode at the moment and can be set up here: http://flask.pocoo.org/docs/errorhandling/

View Article


Answer by Armin Ronacher for Flask 0.10 giving unicode error on session cookie

That's currently an issue with Flask-Login. As far as I know it's fixed in the git version of the extension.

View Article


Pixel Perfect Collision Detection in HTML5 Canvas

I want to check a collision between two Sprites in HTML5 canvas. So for the sake of the discussion, let's assume that both sprites are IMG objects and a collision means that the alpha channel is not 0....

View Article

Answer by Armin Ronacher for How do I use timezones with a datetime object in...

I recommend babel and pytz when working with timezones. Keep your internal datetime objects naive and in UTC and convert to your timezone for formatting only. The reason why you probably want naive...

View Article

Answer by Armin Ronacher for Does Flask support regular expressions in its...

You can hook in custom converters that match for arbitrary expressions: Custom Converterfrom random import randrangefrom werkzeug.routing import Rule, Map, BaseConverter, ValidationErrorclass...

View Article


What's the Name of the Python Module that Formats arbitrary Text to nicely...

A while ago I came across a Python library that formats regular text to HTML similar to Markdown, reStructuredText and Textile, just that it had no syntax at all. It detected indentatations, quotes,...

View Article

Plugin Development for Lektor

I am trying to develop a reStructuredText plugin and doing some basic mistake.My plugin object looks like this:class RSTPlugin(Plugin): name = 'RST' description = 'RST plugin' def on_setup_env(self,...

View Article

Answer by Armin Ronacher for Plugin Development for Lektor

This is a question that come up in the Lektor issue tracker: https://github.com/lektor/lektor/issues/77The answer is that Lektor does not use Jinja filters for field types. Instead one has to implement...

View Article


Answer by Armin Ronacher for Lektor installation fails on MacBookPro OS X 10.6.8

Most likely your version of OS X is too old to support the installation of watchdog with the version of gcc you have. If you cannot upgrade your OS X installation then I recommend installing a recent...

View Article


Answer by Armin Ronacher for php: output[] w/ join vs $output .=

If joined with implode() or join(), PHP is able to better optimize that. It goes through all strings in your list, calculates the length and allocates the required space and fills the space. In...

View Article

Answer by Armin Ronacher for Reverse proxy for Lektor CMS

The development server is not intended to be used for production. The production deployments are based on entirely static content and will resolve static assets correctly if you use the |url filter.

View Article

Answer by Armin Ronacher for My language switcher does not work only from the...

In Lektor versions < 2 there are some limitations with regards to the alts. This is working correctly in Lektor 2 which is currently in development only. But you can install it from the git master...

View Article

Answer by Armin Ronacher for Lektor: No Admin for flow fields

Currently the admin responds really badly to misconfiguration. Usually it just dies with an error you can see in the console window. Most likely the flow block itself does not exist or has a bug in it....

View Article


Answer by Armin Ronacher for Lektor Pagination - TemplateSyntaxError:...

If you are using Lektor 1 (currently released version) syntax errors are sometimes cached unfortunately. Clear the lektor cache to see if that solves the issue (you can do that with lektor clean.

View Article

Answer by Armin Ronacher for Why is assetsDir missing in...

From what I can tell 25.0.0 changes from gradle-core 1.3.1 to gradle-core 2.3.0 and that appears to be a completely different system.This is the old task:...

View Article


LLDB: Execute a python callback after target create to inject symbols

I'm trying to execute a python function after target create so I can iterate over all modules of the target, download missing symbols from the internet (based on GetUUIDString) and then override the...

View Article

Answer by Armin Ronacher for How can I normalize a URL in python

Have a look at this module: werkzeug.utils. (now in werkzeug.urls)The function you are looking for is called "url_fix" and works like this:>>> from werkzeug.urls import url_fix>>>...

View Article


POSIX Async Safety Linter for C/C++

I'm trying to understand if there are some simple ways to add some basic lints for async safety into a codebase. The idea was to keep a list of safe functions to call somewhere and then use clang...

View Article

Answer by Armin Ronacher for Passing HTML to template using Flask/Jinja2

MarkupSafe provides Jinja's autoescaping behavior. You can import Markup and use it to declare a value HTML safe from the code:from markupsafe import Markupvalue = Markup('<strong>The HTML...

View Article

Class to Instance Registry Typing in TypeScript

I'm trying to use classes as input values to a registry method where the return value is a cached instance of that instance. However I do not find a way to make this type safe.What I want is something...

View Article
Browsing all 43 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>