Skip to content

Instantly share code, notes, and snippets.

@benoitbryon
benoitbryon / depends.py
Created January 21, 2015 16:40
Draft utility to figure out what are the primary dependencies of a Python package. Let's list modules that are imported in the code (ignore stdlib and internals).
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Helps you maintain ``install_requires``."""
#: List of modules in standard library.
#: See https://docs.python.org/3/py-modindex.html
PY3_MODULES = [
'__future__',
'__main__',
@benoitbryon
benoitbryon / djangosettings.py
Created December 6, 2013 16:27
Experimental utilities about local settings management with Django. Inspired by django-configglue... but using colander.
# -*- coding: utf-8 -*-
"""Helpers to manage local (project-level, environment-level) settings."""
from django.conf import global_settings
import colander
import json
import yaml
def settings_from_string_mapping(input):
@benoitbryon
benoitbryon / README
Created August 7, 2013 08:24
Notes about migrations... could be used to start a project (Chrysalis?). Are there some projects that already do that?
#########
Chrysalis
#########
Chrysalis (may be renamed to "slough") is a general purpose migration
framework, written in Python.
It focuses on automating actions you perform to upgrade a product.
.. warning::
@benoitbryon
benoitbryon / python_class_based_decorators.py
Last active December 14, 2015 23:49
Experiment class-based decorators for Python: do they help writing, testing and using decorators?
"""Class-based decorators.
This code was originally published as part of an article at
http://tech.novapost.fr/python-class-based-decorators-en.html
To run this file:
.. code-block:: sh
wget -O sample.py https://gist.github.com/benoitbryon/5168914/raw/
@benoitbryon
benoitbryon / django_testing_view_decorators.py
Last active September 16, 2020 14:32
Sample code to illustrate a blog post about testing view decorators in Django apps.
"""Testing Django view decorators.
This code was originally published as part of an article at
http://tech.novapost.fr/django-testing-view-decorators-en.html
To run this file:
.. code-block:: sh
virtualenv --distribute --no-site-packages testing
#!/bin/bash
# openoffice.org headless server script
#
# chkconfig: 2345 80 30
# description: headless openoffice server script
# processname: openoffice
#
# Author: Vic Vijayakumar
# Modified by Federico Ch. Tomasczik
# Modified by Benoit Bryon on 2012 jul 03: added LSB headers.
@benoitbryon
benoitbryon / pep-0423.txt
Last active May 12, 2016 17:38
PEP 423: Naming conventions and recipes related to Python packaging
PEP: 423
Title: Naming conventions and recipes related to packaging
Version: $Revision$
Last-Modified: $Date$
Author: Benoît Bryon <benoit@marmelune.net>
Discussions-To: <distutils-sig@python.org>
Status: Deferred
Type: Informational
Content-Type: text/x-rst
Created: 24-May-2012