This file contains hidden or 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 -*- | |
# | |
# @file curl_request.py | |
# @author kaka_ace <xiang.ace@gmail.com> | |
# @date Jan 10 2015 | |
# @breif learn from human_curl | |
# @refrences: | |
# http://pycurl.sourceforge.net/doc/curlmultiobject.html | |
# http://curl.haxx.se/libcurl/c/curl_multi_info_read.html |
This file contains hidden or 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
tumbler@stikhonov:/tmp$ virtualenv --python=python3.6 test | |
Running virtualenv with interpreter /usr/bin/python3.6 | |
Using base prefix '/usr' | |
New python executable in /tmp/test/bin/python3.6 | |
Also creating executable in /tmp/test/bin/python | |
Installing setuptools, pkg_resources, pip, wheel...done. | |
tumbler@stikhonov:/tmp$ . test/bin/activate | |
(test) tumbler@stikhonov:/tmp$ pip install pycryptodomex==3.4.6 --no-cache-dir | |
Collecting pycryptodomex==3.4.6 | |
Downloading pycryptodomex-3.4.6.tar.gz (6.5MB) |
This file contains hidden or 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 substitute(object): | |
DEBUG = False | |
special = [True, False, None, 0, 1] | |
stub = object() | |
def __init__(self, field_map): | |
self.field_map = field_map |
This file contains hidden or 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
@substitute({ | |
('play_qualityrule_rightholders', u'rightholder_id', 'exact'): 'rightholder', | |
('play_qualityrule_rightholders', 'rightholder_id', 'isnull'): True, | |
('play_qualityrule_user_agents', u'useragent_id', 'isnull'): True, | |
('play_qualityrule_user_agents', u'useragent_id', 'exact'): 'useragent', | |
('play_qualityrule_groups', u'group_id', 'isnull'): True, | |
('play_qualityrule_groups', u'group_id', 'in'): 'group', | |
('play_qualityrule', 'alternative_purchase', 'isnull'): True, | |
('play_qualityrule', 'alternative_purchase', 'exact'): lambda **kw: bool(kw['alternative_sales_rule']), | |
('play_qualityrule_alternative_sales_rule', u'alternativesalesrule_id', 'isnull'): True, |
This file contains hidden or 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 prepare(object): | |
special = [True, False, None, 0, 1] | |
stub = object() | |
DEBUG = False | |
def __init__(self, mapper=None): | |
self.func = None |
This file contains hidden or 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 os | |
import random | |
import sys | |
from collections import namedtuple | |
CAPABILITIES = 'capabilities=0x0' | |
SELABEL = 'selabel=u:object_r:system_file:s0' |
This file contains hidden or 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 abc | |
class StrategyMeta(abc.ABCMeta): | |
strategies = [] | |
@staticmethod |
This file contains hidden or 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/python | |
import gtk | |
import simplejson | |
import urllib2 | |
import subprocess | |
import datetime | |
import string | |
import random | |
import time |
This file contains hidden or 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
try: | |
video = Video.objects.get(track_id=track.id) | |
# Если были ошибки удаления | |
if (video.is_deleted == old_is_deleted | |
and video.action_reason == old_action_reason): | |
video.action_reason = action_reason | |
video.is_deleted = is_deleted | |
video.save() |
This file contains hidden or 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 functools | |
from aiohttp import web | |
from gunicorn.workers import gaiohttp | |
class GunicornWorker(gaiohttp.AiohttpWorker): | |
def web_factory(self, handler): | |
proto = handler() |
NewerOlder