.BANCHO. .FIX. Fix mod rank login error, add exception output at login, add some modules

This commit is contained in:
Nyo
2016-05-17 23:40:34 +02:00
parent afa6fa8563
commit 993079d2dd
35 changed files with 57 additions and 51 deletions

0
helpers/__init__.py Normal file
View File

71
helpers/consoleHelper.py Normal file
View File

@@ -0,0 +1,71 @@
"""Some console related functions"""
from constants import bcolors
import glob
def printServerStartHeader(asciiArt):
"""Print server start header with optional ascii art
asciiArt -- if True, will print ascii art too"""
if asciiArt == True:
print("{} _ __".format(bcolors.GREEN))
print(" (_) / /")
print(" ______ __ ____ ____ / /____")
print(" / ___/ / _ \\/ _ \\/ / _ \\")
print(" / / / / /_) / /_) / / ____/")
print("/__/ /__/ .___/ .___/__/ \\_____/")
print(" / / / /")
print(" /__/ /__/\r\n")
print(" .. o .")
print(" o.o o . o")
print(" oo...")
print(" __[]__")
print(" nyo --> _\\:D/_/o_o_o_|__ u wot m8")
print(" \\\"\"\"\"\"\"\"\"\"\"\"\"\"\"/")
print(" \\ . .. .. . /")
print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^{}".format(bcolors.ENDC))
printColored("> Welcome to pep.py osu!bancho server v{}".format(glob.VERSION), bcolors.GREEN)
printColored("> Made by the Ripple team", bcolors.GREEN)
printColored("> {}https://github.com/osuripple/ripple".format(bcolors.UNDERLINE), bcolors.GREEN)
printColored("> Press CTRL+C to exit\n",bcolors.GREEN)
def printNoNl(string):
"""
Print string without new line at the end
string -- string to print
"""
print(string, end="")
def printColored(string, color):
"""
Print colored string
string -- string to print
color -- see bcolors.py
"""
print("{}{}{}".format(color, string, bcolors.ENDC))
def printError():
"""Print error text FOR LOADING"""
printColored("Error", bcolors.RED)
def printDone():
"""Print error text FOR LOADING"""
printColored("Done", bcolors.GREEN)
def printWarning():
"""Print error text FOR LOADING"""
printColored("Warning", bcolors.YELLOW)