gstreamer/common.py
Thibault Saunier 76e946465f Add meson as a submodule for now
Allowing us to control the meson version in use so that it just works.
2016-10-11 02:00:32 +02:00

44 lines
914 B
Python

import argparse
import subprocess
class Colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
force_disable = False
@classmethod
def disable(cls):
cls.HEADER = ''
cls.OKBLUE = ''
cls.OKGREEN = ''
cls.WARNING = ''
cls.FAIL = ''
cls.ENDC = ''
@classmethod
def enable(cls):
if cls.force_disable:
return
cls.HEADER = '\033[95m'
cls.OKBLUE = '\033[94m'
cls.OKGREEN = '\033[92m'
cls.WARNING = '\033[93m'
cls.FAIL = '\033[91m'
cls.ENDC = '\033[0m'
def git(args, repository_path):
if not isinstance(args, list):
args = [args]
return subprocess.check_output(["git"] + args, cwd=repository_path,
stderr=subprocess.STDOUT).decode()