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
convertion = [ | |
(1024 ** 5, 'P'), | |
(1024 ** 4, 'T'), | |
(1024 ** 3, 'G'), | |
(1024 ** 2, 'M'), | |
(1024 ** 1, 'K'), | |
(1024 ** 0, 'B'), | |
] | |
def size_suffix(bytes): |
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 | |
# Jorge Niedbalski <jnr@pyrosome.org> | |
class Query: | |
def __init__(self): | |
(self.c, self.d) = ([],[]) | |
def a(self, d): | |
self.d.append(d) |
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 zmq | |
import sys | |
context = zmq.Context() | |
socket = context.socket(zmq.PUSH) | |
socket.connect("tcp://172.21.0.49:5000") | |
socket.send_json({'video': sys.argv[1]}) | |
sys.exit(0) |
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 zmq | |
import urlparse | |
import urllib | |
import json | |
DEFAULT_TIMEOUT=5 | |
def parse(link): | |
url_data = urlparse.urlparse(link) | |
query = urlparse.parse_qs(url_data.query) |
NewerOlder