Skip to content

Instantly share code, notes, and snippets.


Burak Arslan plq

View GitHub Profile
plq / output
Created Jun 18, 2011
Foreign keys in object mixins
View output
Traceback (most recent call last):
File "", line 45, in <module>
File "/home/plq/src/sqlalchemy/lib/sqlalchemy/", line 2415, in create_all
File "/home/plq/src/sqlalchemy/lib/sqlalchemy/engine/", line 2178, in _run_visitor
conn._run_visitor(visitorcallable, element, **kwargs)
File "/home/plq/src/sqlalchemy/lib/sqlalchemy/engine/", line 1857, in _run_visitor
File "/home/plq/src/sqlalchemy/lib/sqlalchemy/sql/", line 86, in traverse_single
plq /
Created Jun 26, 2011
This is a script to migrate a dbmail 2.2.x mail store to a maildir store with dovecot extensions. Preserves imap and pop3 uids.
#!/usr/bin/python -tt
# Migration script from dbmail 2.2.x message store to a maildir message store
# with dovecot extensions.
# Tested with dbmail-2.2.17 -> dovecot-2.0.13 on postgresql-9.0.4
# and sqlalchemy-0.7.1.
plq /
Created Sep 26, 2011
django wrapper for rpclib
# This is not yet included in main rpclib distribution because
# it does a lot of unnecessary copying. However, it's reportedly
# working fine, so if you're not caring that much about performance
# you can use this.
from rpclib.server.wsgi import WsgiApplication
from cStringIO import StringIO
from django.http import HttpResponse
plq /
Created Oct 28, 2011
email date inconsistency
import pytz
import email.utils
import time
from datetime import datetime
a =
print email.utils.formatdate(time.mktime(a.timetuple()))
print email.utils.formatdate(time.mktime(a.utctimetuple()) - time.timezone + 1e-6 * a.microsecond)
plq / README
Created Oct 28, 2011
sqlalchemy infinite recursion problem.
to get this example running:
1) mysql -u root -p < localhost.sql
2) edit connection string in
3) run
4) run, witness infinite recursion
plq / encoding.cpp
Created Jan 10, 2012
Qt ile encoding testi.
View encoding.cpp
#include <QString>
#include <QTextCodec>
#include <iostream>
int main(int argc, char *argv[]) {
const char *p = "kıracağım";
// Kaynak kod editörünün encoding'inin utf8 olduğunu varsayarsak;
QTextCodec *utf8 = QTextCodec::codecForName("utf8");
QTextCodec *cp_1254 = QTextCodec::codecForName("Windows-1254");
plq /
Created Apr 3, 2012
Any tag test case.
#!/usr/bin/env python
from lxml import etree
from rpclib.model.primitive import AnyXml
from rpclib.model.complex import ComplexModel
from rpclib.const import xml_ns as ns
from rpclib.util.xml import get_schema_documents
class SomeType(ComplexModel):
plq / badcalc.wsdl
Created May 17, 2012
Using rpclib with wsdl containing namespaced messages
View badcalc.wsdl
<?xml version="1.0" encoding="UTF-8"?>
#!/usr/bin/env python
from suds.client import Client
client = Client("http://localhost:9753/?wsdl")
print client.service.TestService("x")
plq /
Created Aug 10, 2012
Namespace Issue
# This file is one copy from
import sys
import random
import logging
from spyne.model.complex import ComplexModel
from spyne.model.fault import Fault
from spyne.decorator import srpc
from spyne.error import ArgumentError
from spyne.protocol.soap import Soap11
You can’t perform that action at this time.