emre1393 / xtreamui-things

the things related with xtream-ui
GNU General Public License v3.0
38 stars 70 forks source link

help update printc to install.py #23

Open xoceunder opened 11 months ago

xoceunder commented 11 months ago

I'm trying to fix the problem you have if you add more text information

printc("Welcome to Python Examples Start installation? Y/N", col.WARNING)

def printc(rText, rColour=col.OKBLUE, rPadding=0, rLimit=47):
    print("%s ┌─────────────────────────────────────────────────┐ %s" % (rColour, col.ENDC))
    for i in range(rPadding): print("%s │                                                 │ %s" % (rColour, col.ENDC))
    array = [rText[i:i+rLimit] for i in range(0, len(rText), rLimit)]
    for i in array : print("%s │ %s%s%s │ %s" % (rColour, " "*round(23-(len(rText)/2)), i, " "*round(46-(22-(len(rText)/2))-len(rText)), col.ENDC))
    #print("%s │ %s%s%s │ %s" % (rColour, " "*round(23-(len(rText)/2)), rText, " "*round(46-(22-(len(rText)/2))-len(rText)), col.ENDC))
    for i in range(rPadding): print("%s │                                                 │ %s" % (rColour, col.ENDC))
    print("%s └─────────────────────────────────────────────────┘ %s" % (rColour, col.ENDC))
    print(" ")

Screenshot_28