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
sudo apt-get remove ffmpeg x264 libav-tools libvpx-dev libx264-dev yasm | |
sudo apt-get update | |
sudo apt-get -y install autoconf automake build-essential checkinstall git libass-dev \ | |
libgpac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libspeex-dev \ | |
libtheora-dev libtool libvorbis-dev pkg-config texi2html zlib1g-dev | |
cd | |
wget http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz | |
tar xzvf yasm-1.2.0.tar.gz | |
cd yasm-1.2.0 | |
./configure |
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 pytest | |
def is_connected(): | |
import socket | |
try: | |
host = socket.gethostbyname("www.google.com") | |
socket.create_connection((host, 80), 2) | |
return True | |
except: | |
pass |
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 urlparse | |
def is_url(str_): | |
""" | |
Returns True if string is a URL. | |
>>> is_url('not a url') | |
False | |
>>> is_url('http://www.example.com') |
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 time | |
class Timer(object): | |
def __enter__(self): | |
self.start = time.clock() | |
return self | |
def __exit__(self, *args): | |
self.end = time.clock() |
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
ffmpeg -i input.mpg -map 0 -c copy -an -f segment -reset_timestamps 1 -segment_time 10 |
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
""" | |
Requires FFprobe installed. | |
""" | |
import argparse | |
import json | |
import logging | |
import subprocess | |
logger = logging.getLogger('encode_tests') |
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 | |
import inspect | |
import log | |
from PyQt4 import QtCore | |
from PyQt4 import QtGui | |
logger = log.getLogger(__name__) |
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 | |
import inspect | |
import graphviz | |
from PyQt4 import QtCore | |
from PyQt4 import QtGui | |
class MyGraph(object): | |
def __init__(self): |
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 logging | |
import time | |
import pika | |
logger = logging.getLogger(__name__) | |
class Channel(object): |
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 pytest | |
def pytest_addoption(parser): | |
parser.addoption("--integration", action="store_true", help="run integration tests") | |
def pytest_runtest_setup(item): | |
if 'integration' in item.keywords: | |
item.config.getoption("--integration", skip=True) |