Skip to content

Instantly share code, notes, and snippets.

View patrys's full-sized avatar

Patryk Zawadzki patrys

View GitHub Profile
@patrys
patrys / rebrand.py
Created December 13, 2012 14:42 — forked from jimmac/rebrand.rb
import glob
import os
from xml.etree import ElementTree
TEMP = './tmp.svg'
def rebrand(fname, brand):
svg = ElementTree.parse(fname)
for e in svg.iterfind(".//{http://www.w3.org/2000/svg}rect[@id='background']"):
e.set('style', 'fill:url(#%s);' % (brand,))
@patrys
patrys / forms.py
Created August 3, 2011 22:11 — forked from octaflop/forms.py
satchless model example
from django import forms
from satchless.forms.widgets import DecimalInput
from satchless.product.forms import BaseVariantForm
from . import models
class ProductPriceForm(forms.ModelForm):
class Meta:
widgets = {
'price': DecimalInput(min_decimal_places=2),