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
from suds.transport.http import HttpTransport as SudsHttpTransport | |
class WellBehavedHttpTransport(SudsHttpTransport): | |
"""HttpTransport which properly obeys the ``*_proxy`` environment variables.""" | |
def u2handlers(self): | |
"""Return a list of specific handlers to add. | |
The urllib2 logic regarding ``build_opener(*handlers)`` is: |
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
# This code is in the public domain | |
# Author: Raphaël Barrois | |
from __future__ import print_function | |
import datetime | |
import mock | |
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
class InvalidStringHandler(object): | |
"""Custom handler for invalid string in templates.""" | |
def __call__(self): | |
"""Force crashes in {{ foo|sth }}, without breaking __str__.""" | |
import ipdb; ipdb.set_trace() | |
raise ValueError() | |
def __nonzero__(self): | |
"""So that '{% if foo %}' doesn't break.""" |
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 -*- | |
from __future__ import print_function, unicode_literals | |
import socket | |
import sys | |
DEFAULT_LCDD_CHARSET = 'utf-8' |
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
import factory | |
import factory.alchemy | |
import my_tests | |
import my_models | |
class MyFactory(factory.alchemy.SQLAlchemyFactory): | |
class Meta: | |
sqlalchemy_session_loader = my_tests.session_loader | |
model = my_models.Model |
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
# Pas besoin de point-virgule | |
import os; | |
# Utilise open("gaumont.generate.txt", 'w') à la place ; ici tu supprimes le fichier puis l'ouvres en mode "ajout à la fin", | |
# autant l'ouvrir directement en mode "remplacement" | |
os.remove("gaumont.generate.txt"); | |
FILE = open("gaumont.generate.txt", "a+"); | |
print("========================="); | |
print(" GAUMONT GENERATOR BY TCHOTCHO"); |
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
# -*- coding: utf-8 -*- | |
import io | |
import os | |
import sys | |
import time | |
import wsgiref.util | |
import uwsgidecorators |