This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
from abc import ABCMeta | |
class FieldsDict(dict): | |
__metaclass__ = ABCMeta | |
FIELDS = None | |
REQUIRED = None | |
def __init__(self, seq=None, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Example of `bridge' design pattern | |
# This code is part of http://wp.me/p1Fz60-8y | |
# Copyright (C) 2011 Radek Pazdera | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
import threading | |
import subprocess | |
import traceback | |
import shlex | |
class Command(object): | |
""" | |
Enables to run subprocess commands in a different thread with TIMEOUT option. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python2.7 | |
''' | |
http://stackoverflow.com/questions/7184375/how-to-find-import-name-of-any-package-in-python | |
''' | |
import distutils.core | |
import sys | |
import os |