Skip to content

Instantly share code, notes, and snippets.

View blogger_import.py
import argparse
import xml.etree.cElementTree as ET
import os
def is_post(node):
t = node.find('{http://www.w3.org/2005/Atom}category').get('term')
d = node.find('{http://purl.org/atom/app#}control')
return (not d) and (t == 'http://schemas.google.com/blogger/2008/kind#post')
@fedepaol
fedepaol / csv_loader.py
Created Apr 8, 2014
Loader to generate android xml resources and sqllite file
View csv_loader.py
from lxml import etree as ET
import sqlite3
import os
CREATE_ITEMS = 'create table Item (_id integer primary key, Name text, kind integer, calories integer);'
CREATE_ITEM_PER_MONTHS = 'create table ItemPerMonth (ItemId integer, Month integer, Freshness integer, Area integer);'
CREATE_ITEM_PREFERRED = 'create table PreferredItem (PreferredItemId integer);'
file_list = ['fruit.sqlinit']
@fedepaol
fedepaol / ink_android.py
Created Nov 21, 2012
Inkscape android res generator
View ink_android.py
import argparse
import sys
import os
INKSCAPE_BIN = '/Applications/Inkscape.app/Contents/Resources/bin/inkscape'
LDPI = ('drawable-ldpi', '48')
MDPI = ('drawable-mdpi', '72')
View bbb.xml
<dependency>
<groupId>com.pivotallabs</groupId>
<artifactId>robolectric</artifactId>
<version>1.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<repositories>
View aaa.xml
<dependency>
<groupId>com.pivotallabs</groupId>
<artifactId>robolectric</artifactId>
<version>X.X.X</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
You can’t perform that action at this time.