Skip to content

Instantly share code, notes, and snippets.

Avatar

Jonas Lundberg lundberg

  • Stockholm, Sweden
View GitHub Profile
@lundberg
lundberg / csv_io.py
Last active Aug 29, 2015
Python csv io router
View csv_io.py
import codecs
import csv
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
class CSVReadWriter(object):
@lundberg
lundberg / gist:8003494
Created Dec 17, 2013
Djedi CMS jinja2 node tag
View gist:8003494
# coding=utf-8
from string import strip
import textwrap
import cio
from djedi.templatetags.djedi_tags import render_node
from jinja2 import nodes
from jinja2.ext import Extension
from jinja2.filters import do_mark_safe
from jinja2.nodes import Name, Const