Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#runner = unittest.TextTestRunner(failfast = True)
#runner = redgreenunittest.TextTestRunner(failfast = True)
runner = blinkinlabsunittest.BlinkinlabsTestRunner(failfast = True)
result = runner.run(unittest.TestLoader().loadTestsFromTestCase(EightByEightTests))
if len(result.failures) > 0 or len(result.errors) > 0:
rig.testrig.setLED("pass", False)
rig.testrig.setLED("fail", True)
message = """ ______ _____ _
| ____/\ |_ _| |
| |__ / \ | | | |
| __/ /\ \ | | | |
| | / ____ \ _| |_| |____
|_|/_/ \_\_____|______|"""
userinterface.interface.DisplayMessage(message, fgcolor=colorama.Fore.BLACK, bgcolor=colorama.Back.RED)
else:
rig.testrig.setLED("pass", True)
rig.testrig.setLED("fail", False)
message = """ ____ _ __
/ __ \ | | / /
| | | | | |/ /
| | | | | |
| |__| | | |\ \\
\____/ |_| \_\\"""
userinterface.interface.DisplayMessage(message, fgcolor=colorama.Fore.BLACK, bgcolor=colorama.Back.GREEN)
time.sleep(1)
# See the License for the specific language governing permissions and
# limitations under the License.
""" This python file is responsible for generating colorized notifiers.
"""
import sys
import re
from colorama import init, Fore, Back, Style
init()
COLORS = {
'none' : "",
'default' : Style.RESET_ALL,
'black' : Fore.BLACK,
'red' : Fore.RED,
'green' : Fore.GREEN,
'yellow' : Fore.YELLOW,
'blue' : Fore.BLUE,
'magenta' : Fore.MAGENTA,
'cyan' : Fore.CYAN,
'white' : Fore.WHITE,
'on_black' : Back.BLACK,
'on_red' : Back.RED,
'on_green' : Back.GREEN,
'on_yellow' : Back.YELLOW,
'on_blue' : Back.BLUE,
'on_magenta' : Back.MAGENTA,
'on_cyan' : Back.CYAN,
'on_white' : Back.WHITE,
def run(self, opts):
print("-- OpenOB Audio Link")
print(" -- Starting Up")
print(" -- Parameters: %s" % opts)
# We're now entering the realm where we should desperately try and maintain a link under all circumstances forever.
while True:
try:
# Set up redis and connect
config = None
while True:
try:
config = redis.Redis(opts.config_host)
print(" -- Connected to configuration server")
break
except Exception, e:
print(Fore.BLACK + Back.RED + " -- Couldn't connect to Redis! Ensure your configuration host is set properly, and you can connect to the default Redis port on that host from here (%s)." % e)
print(" Waiting half a second and attempting to connect again." + Fore.RESET + Back.RESET)
time.sleep(0.5)
# So if we're a transmitter, let's set the options the receiver needs to know about
link_key = "openob2:"+opts.link_name+":"
if opts.mode == 'tx':
if opts.encoding == 'celt' and int(opts.bitrate) > 192:
print(Fore.BLACK + Back.YELLOW + " -- WARNING: Can't use bitrates higher than 192kbps for CELT, limiting" + Fore.RESET + Back.RESET)
opts.bitrate = 192
# We're a transmitter!
config.set(link_key+"port", opts.port)
config.set(link_key+"jitter_buffer", opts.jitter_buffer)
config.set(link_key+"encoding", opts.encoding)
config.set(link_key+"bitrate", opts.bitrate)
config.set(link_key+"multicast", opts.multicast)
config.set(link_key+"input_samplerate", opts.samplerate)
def _colours(self):
if self.job.is_missing:
return Back.WHITE + Fore.BLACK + Style.DIM, Back.WHITE + Fore.BLACK + Style.DIM
elif self.job.is_building:
return Back.YELLOW + Fore.BLACK + Style.DIM, Back.YELLOW + Fore.BLACK + Style.DIM
elif self.job.is_successful:
return Back.GREEN + Fore.BLACK + Style.DIM, Back.GREEN + Fore.BLACK + Style.DIM
else:
return Back.RED + Fore.WHITE + Style.BRIGHT, Back.RED + Fore.BLACK + Style.DIM
def print_highlighted(line, hl_color=Back.WHITE):
"""
Print a highlighted line
"""
try:
# Highlight positives
colorer = re.compile(r'([^\s]+) POSITIVES: ([1-9]) ')
line = colorer.sub(Fore.YELLOW + r'\1 ' + 'POSITIVES: ' + Fore.YELLOW + r'\2 ' + Style.RESET_ALL, line)
colorer = re.compile(r'([^\s]+) POSITIVES: ([0-9]+) ')
line = colorer.sub(Fore.RED + r'\1 ' + 'POSITIVES: ' + Fore.RED + r'\2 ' + Style.RESET_ALL, line)
# Keyword highlight
colorer = re.compile(r'([A-Z_]{2,}:)\s', re.VERBOSE)
line = colorer.sub(Fore.BLACK + hl_color + r'\1' + Style.RESET_ALL + ' ', line)
print line
except Exception, e:
pass
def dev_guid(env, save = True):
with open(join(env.subst("$PROJECT_DIR"), "src", "app_manifest.json"), 'r+') as f:
data = json.load(f)
NEW = True
if 'ComponentId' in data:
try:
val = UUID(data['ComponentId'], version=4)
NEW = False
except ValueError:
print( Fore.RED + "ERROR GUID ", )
if True == NEW:
GUID = str(uuid.uuid4()).upper()
data['ComponentId'] = GUID
print( Fore.BLUE + "GENERATED NEW GUID", GUID, Fore.BLACK )
if True == save:
f.seek(0)
json.dump(data, f, indent=4)
f.truncate()
env.GUID = data['ComponentId']
return env.GUID
# Ignore concerns about docstrings, since _all_ methods with docstrings
# are picked up by sphinx-autodoc
# pylint: disable=missing-docstring
from colorama import Fore, Back
# Objects for the card module
SUIT_SYMBOL_DICT = {
"diamonds": {"symbol": "♦", "style": Back.WHITE + Fore.RED},
"hearts": {"symbol": "♥", "style": Back.WHITE + Fore.RED},
"clubs": {"symbol": "♣", "style": Back.WHITE + Fore.BLACK},
"spades": {"symbol": "♠", "style": Back.WHITE + Fore.BLACK},
"none": {"symbol": " ", "style": Back.WHITE + Fore.BLACK},
}
CARD_FACE_DICT = {
"A": {"coords": [(3, 5)]},
"2": {"coords": [(0, 2), (6, 8)]},
"3": {"coords": [(0, 5), (3, 5), (6, 5)]},
"4": {"coords": [(0, 2), (0, 8), (6, 2), (6, 8)]},
"5": {"coords": [(0, 2), (0, 8), (3, 5), (6, 2), (6, 8)]},
"6": {"coords": [(0, 3), (3, 3), (6, 3), (0, 7), (3, 7), (6, 7)]},
"7": {"coords": [(0, 3), (3, 3), (6, 3), (1, 5), (0, 7), (3, 7), (6, 7)]},
"8": {"coords": [(0, 3), (3, 3), (6, 3), (1, 5), (5, 5), (0, 7), (3, 7), (6, 7)]},
"9": {
"coords": [
(0, 2),
(2, 2),
def _start_colour( self, meaning ):
if meaning == 'error':
return colorama.Fore.RED
elif meaning == 'warning':
return colorama.Fore.MAGENTA
elif meaning == 'summary':
return colorama.Fore.BLACK
elif meaning == 'passed':
return colorama.Fore.GREEN
elif meaning == 'success':
return colorama.Fore.GREEN
elif meaning == 'unexpected_success':
return colorama.Fore.GREEN
elif meaning == 'expected_failure':
return colorama.Fore.YELLOW
elif meaning == 'failure':
return colorama.Fore.RED
elif meaning == 'failed':
return colorama.Fore.RED
elif meaning == 'aborted':
return colorama.Fore.RED
elif meaning == 'skipped':
return colorama.Fore.BLACK
def cs_x():
print(Back.WHITE+Fore.BLACK+"WARNING"+Fore.RESET+Back.RESET)
os.system("echo Do not forget to enter input as requested")
sock=sk.socket(sk.AF_INET,sk.SOCK_STREAM)
print(Fore.RED+"checking Root!!"+Fore.RESET)
yes=("Y" or "y" or "yes" or "Yes")
no=("N" or "n" or "no" or "No")
dake=(input(Fore.RED+"Do you Have root? Type Y or N : "+Fore.RESET))
if dake!=((yes)):
os.system("killall *")
main_1=(Fore.BLUE+"1.Start Tor")
main_2=("2.Start DDOS Botnet")
main_3=("3.Edit Proxychains/Tor file(requires root)")
main_4=("0.Exit Hax4Us"+Fore.RESET)
os.system("figlet 100% loaded")
os.system("toilet -F metal HaxRuS")
print (main_1)
print (main_2)