Skip to content

Instantly share code, notes, and snippets.

@florentx
florentx / roomstairs
Created December 11, 2009 20:46 — forked from NaPs/gist:254376
R OO M S TAIRS
@florentx
florentx / bbreport.json
Created August 18, 2010 07:08
bbreport web view
{
"gone": [
{
"rules": [
{
"test": "test_multiprocessing",
"message": "$",
"builder": ".* Ubuntu 3.x"
}
],
# -*- coding: utf-8 -*-
"""String formatting for Python 2.5.
This is an implementation of the new string formatting (PEP 3101).
Most PEP 3101 features are implemented.
TODO:
- alignment '='
- thousand separator
"""
@florentx
florentx / openerp6_trace.diff
Last active October 5, 2015 15:38
Trace your OpenERP errors
=== modified file 'openerp/osv/osv.py'
--- openerp/osv/osv.py 2012-02-08 16:13:12 +0000
+++ openerp/osv/osv.py 2012-05-08 21:50:42 +0000
@@ -23,6 +23,8 @@
from functools import wraps
import logging
+import sys
+import traceback
from psycopg2 import IntegrityError, errorcodes
#!python
import re
import pep8
# This is a very long line - 79 chars --------------------------------123456789
# This is a very [[with-poporg][long line]] - 79 chars --------------------------------123456789
# This is a very [[with-poporg][long line]] - 80 chars --------------------------------1234567890
@florentx
florentx / pep8xml.py
Last active June 6, 2018 05:43
XML output format for pep8
#!python
import pep8
from xml.etree import ElementTree as ET
def prettyindent(elem, level=0):
# Adapted from http://effbot.org/zone/element-lib.htm#prettyprint
ind = "\n" + level * " "
if level:
elem.tail = ind
@florentx
florentx / flake8nodelay
Last active December 15, 2015 08:39
Output Flake8 errors immediately
#!python
# https://github.com/jcrocholl/pep8/issues/181
import sys
import pep8
from flake8.engine import get_style_guide
from flake8.main import DEFAULT_CONFIG
class ImmediateReport(pep8.BaseReport):

Bootstrap OpenERP 6.1 or 7.0

This repository contains a zc.buildout bundle to install and configure OpenERP and some related tools on Debian or Ubuntu. This is tested on Debian Squeeze.

Features:

  • install and configure OpenERP 6.1 or 7.0 (using anybox.recipe.openerp)
  • install and configure supervisor
@florentx
florentx / gist:5292155
Created April 2, 2013 13:22
Split a Bazaar repository (example of Pyflakes)
# * install latest Bazaar
# * install bzr-fastimport
# * `pip install fastimport`
bzr branch lp:divmod.org divmod.org
bzr fast-export --no-plain divmod.org divmod.fi.gz
bzr fast-import-filter -i Pyflakes/ divmod.fi.gz > pyflakes.fi
bzr init pyflakes-fi
cd pyflakes-fi
bzr fast-import ../pyflakes.fi
# -*- coding: utf-8 -*-
import pep8
class MyReport(pep8.BaseReport):
def __init__(self, options):
super(MyReport, self).__init__(options)
self.all_errors = []