Exemplo n.º 1
0
    def listWords(self):
        #为了做好数据的存储,我需要对这个函数做一个文件来记录自己背单词记录,返回一个值
        print '================================================================'
        print "如果推出请输入  ~quit"
        word = ''
        list = []
        while (word != "~quit"):
            try:

                url = 'http://xtk.azurewebsites.net/BingDictService.aspx?Word='
                word = raw_input("input           -----   ")
                if (word == '~quit'):
                    break
                api = url + word
                response = urllib2.urlopen(api + '&Samples=false')
                obj = response.read()
                en = json.loads(obj)
                mean1 = en['defs'][0]['pos'] + "---" + en['defs'][0]['def']
                mean2 = en['defs'][1]['pos'] + "---" + en['defs'][1]['def']
                print mean1
                print mean2
                pyfiglet.print_figlet(word)
                if word in list:
                    print '================================================================'
                    continue
                list.append(word)
                self.write_view_words(word, mean1, mean2)
                self.write_list_log(word)
                print '================================================================'
            except:
                print '-------------这个单词可能找不到,换一个再来----------------'
        return
Exemplo n.º 2
0
def print_heading(text, options):
    if options.htmlify:
        print '<a name="%s"></a>' % text
    print "-"*80
    print_figlet(text)
    print text.center(80)
    print "-"*80
Exemplo n.º 3
0
    def show(self):  #我要一个非常壮观的输出
        color = {
            0: Fore.RED,
            1: Fore.LIGHTRED_EX,
            2: Fore.YELLOW,
            3: Fore.LIGHTGREEN_EX,
            4: Fore.GREEN
        }
        filelist = self.getFile(self.allDaysLogPath)  #~/wallet/log/dayListLog/
        words = set()
        num = 25

        for file in filelist:
            word = self.get_word(file)
            words = word | words

        a = list(words)
        i = 0
        k = 0
        while i < len(a):
            try:
                print(color[(k + 0) % 5] + a[i] + ' ' * (num - len(a[i])) +
                      color[(k + 1) % 5] + a[i + 1] + ' ' *
                      (num - len(a[i + 1])) + color[(k + 2) % 5] + a[i + 2] +
                      ' ' * (num - len(a[i + 2])) + color[(k + 3) % 5] +
                      a[i + 3] + ' ' * (num - len(a[i + 3])) +
                      color[(k + 4) % 5] + a[i + 4])
                i += 5
                k += 1
            except:
                i += 5
                continue
        pyfiglet.print_figlet("Wallet : " + str(len(words)))
Exemplo n.º 4
0
    def print_fig(self, stop: Optional[bool] = False):
        """Prints either the startup or shutdown Figlet depending on the value of stop."""

        local_config = config.figlet

        try:
            print_figlet(
                text=local_config.stop if stop else local_config.start,
                width=local_config.width,
                font=local_config.font)

        # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        # the configured font doesn't exist, so we force a change
        # to the loaded config and send a warning message to the console
        # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        except FontNotFound:
            console.warn(text=f"{local_config.font} font not found, fixing.")

            # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            # attrdict creates shallow copies internally when we access it
            # using the attribute syntax, so we have to use the key syntax
            # to be able to edit the attributes
            # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            config["figlet"]["font"] = "standard"

            print_figlet(
                text=local_config.stop if stop else local_config.start,
                width=local_config.width,
                font="standard")
Exemplo n.º 5
0
def nsBanner(ns):
    pyfiglet.print_figlet(
            nsGet(ns, "/etc/name").value,
            nsGet(ns, "/etc/bannerFont", "isometric2").value,
            "GREEN:"
        )
    tbl = Texttable(nsGet(ns, "/etc/bannerTableWidth", 120).value)
    tbl.set_deco(Texttable.HEADER)
    tbl.add_rows(
            [
                ["Variable", "Value", "Description"],
                ["/etc/name", nsGet(ns, "/etc/name").value, "Name of the application"],
                ["/etc/hostname", nsGet(ns, "/etc/hostname").value, "Hostname"],
                ["/sys/env/platform/platform", nsGet(ns, "/sys/env/platform/platform").value, "Host platform"],
                ["/sys/env/platform/python", nsGet(ns, "/sys/env/platform/python").value, "Version of the Python"],
                ["/sys/env/platform/system", nsGet(ns, "/sys/env/platform/system").value, "OS Name"],
                ["/sys/env/user", nsGet(ns, "/sys/env/user").value, "Name of the user"],
                ["/sys/env/home", nsGet(ns, "/sys/env/home").value, "Home directory"],
                ["/sys/env/apphome", nsGet(ns, "/sys/env/apphome").value, "Application home"],
                ["/sys/env/pidFile", nsGet(ns, "/sys/env/pidFile").value, "PID file"],
                ["/config/user.library", nsGet(ns, "/config/user.library").value, "Application library"],
                ["/etc/daemonize", nsGet(ns, "/etc/daemonize").value, "Become daemon ?"],
                ["/etc/flags/internalServer",nsGet(ns, "/etc/flags/internalServer", False).value,"Enable internal server"],
                ["/etc/version", str(nsGet(ns, "/etc/version").value), "Application version"],
                ["/etc/release", nsGet(ns, "/etc/release").value, "Application release"],
                ["/etc/author", nsGet(ns, "/etc/author").value, "Author of application"],
                ["/etc/author.email", nsGet(ns, "/etc/author.email").value, "Author's email"],
                ["/etc/coref/version", str(nsGet(ns, "/etc/coref/version").value), "core.F version"],
                ["/etc/coref/release", nsGet(ns, "/etc/coref/release").value, "core.F release"],
                ["/config/RPCCatchCalls", nsGet(ns, "/config/RPCCatchCalls").value, "Trace RPC"],
                ["/etc/answer", nsGet(ns, "/etc/answer").value, "THE ANSWER"],
            ]
    )
    print(tbl.draw())
    return True
Exemplo n.º 6
0
def list_plugins(ctx: click.Context) -> None:
    """List all global plugins."""
    session = ctx.obj["session"]
    tablefmt = ctx.obj["tablefmt"]
    font = ctx.obj["font"]

    print_figlet("Plugins", font=font, width=160)
    plugins = get("plugins", lambda: general.all_of("plugins", session))
    services = get("services", lambda: general.all_of("services", session))
    consumers = get("consumers", lambda: general.all_of("consumers", session))

    for p in plugins:
        substitude_ids(p)
        p = sort_dict(p)
        p["config"] = json_pretty(p["config"])
        parse_datetimes(p)
        service_id = p.get("service.id")
        if service_id:
            for s in services:
                if s["id"] == service_id:
                    p["service_name"] = s["name"]
                    break
        consumer_id = p.get("consumer.id")
        if consumer_id:
            for c in consumers:
                if c["id"] == consumer_id:
                    p["consumer_name"] = c["username"]
                    p["consumer_custom_id"] = c["custom_id"]
                    break

    click.echo(
        tabulate(sorted(plugins, key=itemgetter("name")),
                 headers="keys",
                 tablefmt=tablefmt))
Exemplo n.º 7
0
    async def on_ready(self):
        print_figlet(self.bot.config.figlet)

        display = self.bot.config.presence
        await self.bot.change_presence(activity=display.activity,
                                       status=display.status)

        with sqlite3.connect(self.bot.config.database) as db:
            for table, columns in (
                ("Prefixes", "Used_ID TEXT, Prefixes TEXT"), ("Settings",
                                                              "Case_ID TEXT"),
                ("Cases",
                 "Mod_ID TEXT, User_ID TEXT, Case_ID TEXT, Msg_ID TEXT, Punishment TEXT, Reason TEXT"
                 ), ("Mute_Evaders", "User_ID TEXT"),
                ("Duty",
                 "User_ID TEXT, Admin TEXT, Mod TEXT, Staff TEXT, Support TEXT"
                 ), ("Tags", "Owner_ID TEXT, Name TEXT, Content TEXT")):
                db.cursor().execute(
                    f"CREATE TABLE IF NOT EXISTS {table} ({columns})")

            if db.cursor().execute(
                    "SELECT * FROM Settings").fetchone() is None:
                db.cursor().execute("INSERT INTO Settings VALUES ('0')")

            db.commit()
Exemplo n.º 8
0
    def listWordsMakeMp3(self):
        print '================================================================'
        print "如果推出请输入  ~quit"
        word = ''
        list = []
        while (word != "~quit"):
            try:

                url = 'http://xtk.azurewebsites.net/BingDictService.aspx?Word='
                word = raw_input("input           -----   ")
                if (word == '~quit'):
                    break
                api = url + word
                response = urllib2.urlopen(api + '&Samples=false')
                obj = response.read()
                en = json.loads(obj)
                mean1 = en['defs'][0]['pos'] + "---" + en['defs'][0]['def']
                mean2 = en['defs'][1]['pos'] + "---" + en['defs'][1]['def']
                mp3 = en['pronunciation']['AmEmp3']
                print mean1
                print mean2
                pyfiglet.print_figlet(word)
                if word in list:
                    print '================================================================'
                    continue
                list.append(word)
                self.write_view_words(word, mean1, mean2)
                self.write_list_log(word)
                self.write_mp3_words(mp3)
                print '================================================================'
            except:
                print '-----------------------------------------------'
Exemplo n.º 9
0
def Trace():
    pyfiglet.print_figlet("__________", font="standard", colors=colors1)
    cprint('[+] Do You want to enter IP or URL [ip/url] ------> ',
           'red',
           attrs=['bold'],
           end=' ')
    res = input()
    print()
    if (res == 'ip' or res == 'IP' or res == 'Ip'):
        cprint('[+] Input the IP to be Checked ------> ',
               'red',
               attrs=['bold'],
               end=' ')
        ip = input()
        print()
    else:
        cprint('[+] Input the URL to be Checked ------> ',
               'red',
               attrs=['bold'],
               end=' ')
        url = input()
        ip = gethostbyname(url)
        print()
    os.system(f'traceroute {ip} > files/trace.txt')
    f = open('files/trace.txt', 'r')
    a = f.readlines()
    f.close()
    b = len(a) - 1
    cprint(f'[+] The No of Hops ------> {b} ', 'red', attrs=['bold'], end=' ')
Exemplo n.º 10
0
 def _start(self):
     while True:
         big, msg = self.queue.get()
         if big:
             pyfiglet.print_figlet(msg, self.font)
         else:
             print(msg)
Exemplo n.º 11
0
 def upgrade(self):
     '''
     与其他cube合并,使自身数字翻倍,active置为False,同时判断是否已经完成游戏'''
     self.value = 2 * self.value
     self.__active = False
     if self.value > 1023:
         print_figlet("congradulations!")
         sys.exit()
Exemplo n.º 12
0
 def printTop10Committers(collection):
     pyfiglet.print_figlet("The Top 10s", font='small')
     print("Top 10 committers")
     top10commiters = sorted(collection, key=collection.get, reverse=True)[:10]
     i = 1
     for tc in top10commiters:
         print("[",i,"]", "Email:", tc, "Count:", collection[tc], "Total %", collection[tc]/count*100)
         i = i + 1
Exemplo n.º 13
0
def cli(log_level, verbose, show_banner):
    if verbose:
        default_logger_level = "INFO" if verbose == 1 else "DEBUG"
    else:
        default_logger_level = getattr(logging, log_level.upper())
    config_loggers(default_logger_level=default_logger_level)
    if show_banner:
        # print the ASCII banner
        pyfiglet.print_figlet(f"{PACKAGE_NAME}, version {PACKAGE_VERSION}")
Exemplo n.º 14
0
 def log(self):
     filelist = self.getFile(self.allDaysLogPath)
     #省去所有文件读写的内容
     total = 0
     for day in filelist:
         count = self.countWords(day)
         dayName = day.split('/')[-1].strip('.txt')
         print dayName + '  ------------------------------  ' + str(count)
         total += count
     pyfiglet.print_figlet("Wallet   :   " + str(total))
Exemplo n.º 15
0
def print_figlet(text, **kwargs):
    """
    Print text with figlet font.
    There is also
    """
    if Figlet is None:
        logger.warning("pyfiglet module not available.")
        print(text)
        return
    pyfiglet.print_figlet(text) # This will print and not actually return anything.
Exemplo n.º 16
0
def print_figlet(text, **kwargs):
    """
    Print text with figlet font.
    There is also
    """
    if Figlet is None:
        logger.warning("pyfiglet module not available.")
        print(text)
        return
    pyfiglet.print_figlet(
        text)  # This will print and not actually return anything.
Exemplo n.º 17
0
def list_routes(ctx: click.Context, full_plugins: bool) -> None:
    """List all routes along with relevant information."""
    session = ctx.obj["session"]
    tablefmt = ctx.obj["tablefmt"]
    font = ctx.obj["font"]

    print_figlet("Routes", font=font, width=160)

    services = get("services", lambda: general.all_of("services", session))
    routes = get("routes", lambda: general.all_of("routes", session))
    plugins = get("plugins", lambda: general.all_of("plugins", session))

    data = []
    for r in routes:
        rdata = {
            "route_id": r["id"],
            "service_name": None,
            "methods": r["methods"],
            "protocols": r["protocols"],
            "hosts": r.get("hosts"),
            "paths": r["paths"],
            "whitelist": set(),
            "blacklist": set(),
            "plugins": [],
        }
        for s in services:
            if s["id"] == r["service"]["id"]:
                rdata["service_name"] = s["name"]
                break
        for p in plugins:
            if p.get("route", {}) is None:
                # kong 1.x sets route to none, if plugin is not accoziated to a route
                continue
            if r["id"] in (p.get("route_id"), p.get("route", {}).get("id")):
                if p["name"] == "acl":
                    rdata["whitelist"] |= set(p["config"].get("whitelist", []))
                    rdata["blacklist"] |= set(p["config"].get("blacklist", []))
                elif full_plugins:
                    rdata["plugins"] += [f"{p['name']}:\n{json_pretty(p['config'])}"]
                else:
                    rdata["plugins"] += [p["name"]]
        rdata["whitelist"] = "\n".join(sorted(rdata["whitelist"]))
        rdata["blacklist"] = "\n".join(sorted(rdata["blacklist"]))
        rdata["plugins"] = "\n".join(rdata["plugins"])
        data.append(rdata)

    click.echo(
        tabulate(
            sorted(data, key=itemgetter("service_name")),
            headers="keys",
            tablefmt=tablefmt,
        )
    )
Exemplo n.º 18
0
 def browse(self, showScores=True):
     """View posts"""
     subreddit = self.reddit.subreddit(self.subreddit)
     posts = getattr(subreddit, self.sort)()  # Get posts in subreddit
     pyfiglet.print_figlet("/r/{}".format(self.subreddit))
     for post in posts:
         print("-" * 40)
         print(post.title)
         print(getattr(post, "selftext", "-"))
         if showScores:
             print("Score: {}".format(post.score))
         print("-" * 40 + "\n")
Exemplo n.º 19
0
 def show():
     text = "Sample"
     fonts = pyfiglet.FigletFont.getFonts()
     times = 1
     for i in fonts:
         print(get_colors.white() + f"[{times}] " +
               get_colors.randomize1() + "Font Name: " +
               get_colors.randomize2() + f"{i}")
         times += 1
         print(get_colors.cyan() + "[" + get_colors.green() + "+" +
               get_colors.cyan() + "]" + get_colors.pink() +
               " Example: \n" + get_colors.randomize3())
         pyfiglet.print_figlet(text, i)
         print(get_colors.magento() + "#" * 70 + get_colors.white())
Exemplo n.º 20
0
def list_services(ctx: click.Context, full_plugins: bool) -> None:
    """List all services along with relevant information."""
    session = ctx.obj["session"]
    tablefmt = ctx.obj["tablefmt"]
    font = ctx.obj["font"]

    print_figlet("Service", font=font, width=160)

    services_data = get("services",
                        lambda: general.all_of("services", session))
    plugins_data = get("plugins", lambda: general.all_of("plugins", session))

    data = []
    for s in services_data:
        sdata = {
            "service_id": s["id"],
            "name": s["name"],
            "protocol": s["protocol"],
            "host": s["host"],
            "port": s["port"],
            "path": s["path"],
            "whitelist": set(),
            "blacklist": set(),
            "plugins": [],
        }
        for p in plugins_data:
            substitude_ids(p)
            if s["id"] == p.get("service.id"):
                if p["name"] == "acl":
                    sdata["whitelist"] |= set(
                        p["config"].get("whitelist") or []) | set(
                            p["config"].get("allow") or [])
                    sdata["blacklist"] |= set(
                        p["config"].get("blacklist") or []) | set(
                            p["config"].get("deny") or [])
                elif full_plugins:
                    sdata["plugins"] += [
                        f"{p['name']}:\n{json_pretty(p['config'])}"
                    ]
                else:
                    sdata["plugins"] += [p["name"]]
        sdata["whitelist"] = "\n".join(sorted(sdata["whitelist"]))
        sdata["blacklist"] = "\n".join(sorted(sdata["blacklist"]))
        sdata["plugins"] = "\n".join(sdata["plugins"])
        data.append(sdata)

    click.echo(
        tabulate(sorted(data, key=itemgetter("name")),
                 headers="keys",
                 tablefmt=tablefmt))
Exemplo n.º 21
0
def nsHelp(ns, path):
    help = nsGet(ns, path)
    if isNothing(help):
        help = Just(colored.red("Help not found"))
    template = Tpl(help.value)
    help = Just(template(ns))
    r = Renderer()
    out = io.StringIO()
    r.render(help.value, output=out)
    help = out.getvalue()
    out.close()
    pyfiglet.print_figlet("HELP: {} >".format(os.path.basename(path)))
    with indent(4, quote=colored.blue(' > ')):
        for h in help.split('\n'):
            puts(h)
    return ns
def Parser():
    parser = ArgumentParser(description=print_figlet("COG", "doom"))
    parser.add_argument("-o",
                        "--output",
                        help="pickle file name that generate",
                        required=True)
    parser.add_argument("-d",
                        "--datatype",
                        help="use datatype property list to create pickle",
                        action="store_true")
    parser.add_argument("-b",
                        "--object",
                        help="use object property list to create pickle",
                        action="store_true")
    parser.add_argument("-n",
                        "--name",
                        help="use named individuals list to create pickle",
                        action="store_true")
    parser.add_argument("-c",
                        "--class",
                        help="use class list to create pickle",
                        action="store_true",
                        dest="class_rep")
    parser.add_argument("--combine",
                        help="use one of the combination to create pickle file",
                        choices=["name_predicate", "class_predicate"])
    return parser
Exemplo n.º 23
0
def OpPorts():
    pyfiglet.print_figlet("__________", font="standard", colors=colors1)
    cprint('[+] Input the IP or URL to be Checked ------> ',
           'red',
           attrs=['bold'],
           end=' ')
    res = input()
    print()
    nmap = nmap3.NmapHostDiscovery()
    results = nmap.nmap_portscan_only(res)
    for i in results[res]:
        cprint(
            f'[+] {i["service"]["name"]}({i["portid"]}) : {i["state"].upper()} [+]',
            'green',
            attrs=['bold'])
        print()
Exemplo n.º 24
0
 def browse(self, showScores=True):
     """View posts"""
     try:
         subreddit = self.reddit.subreddit(self.subreddit)
         posts = getattr(subreddit, self.sort)()  # Get posts in subreddit
         pyfiglet.print_figlet("/r/{}".format(self.subreddit))
         for post in posts:
             print("-" * 40)
             print(post.title)
             print(getattr(post, "selftext", "-"))
             if showScores:
                 print("Score: {}".format(post.score))
             print("-" * 40 + "\n")
     except prawcore.exceptions.InvalidToken:
         raise prawcore.exceptions.InvalidToken(
             "The API id and secret key pair is invalid, please input valid API keys."
         )
Exemplo n.º 25
0
def wsMenu():
    while(1):
        pyfiglet.print_figlet("WSMenu",font="slant")
        print("_______________________________________________")
        print("=>  WebServer Configuration:                   |")
        print("|0]  Setup HTTPD service                       |")
        print("|1]  Start HTTPD service                       |")
        print("|2]  Add a WebPage                             |")
        print("|3]  Restart HTTPD                             |")
        print("|4]  Stop HTTPD Services                       |")
        print("|5]  Exit                                      |")
        print("|______________________________________________|")
        option = input("\nSelect an option: ")
        if(option=="0"):
            print("|i] For local setup ")
            print("|ii] For remote setup")
            suboption= input("\n Select an option:")
            if(suboption=="i"):
                os.system(f"yum install httpd")
            elif(suboption=="ii"):
                ipws=input("Enter IP for remote connection:")
                pwdws=input("Enter password for remote connection")
                os.system(f"sshpass -p {pwdws} ssh root@{ipws} systemlctl enable httpd")
                os.system(f"yum install httpd")
        elif(option=="1"):
            print("|1] For local setup ")
            print("|2] For remote setup")
            suboption= input("\n Select an option:")
            if(suboption=="1"):
                os.system(f"systemctl start httpd")
            elif(suboption=="2"):
                ipws=input("Enter IP for remote connection:")
                pwdws=input("Enter password for remote connection")
                os.system(f"sshpass -p {pwdws} ssh root@{ipws} systemlctl enable httpd")
        elif(option=="2"):
            filews=input("enter file path: ")
            os.system(f"cp -rvf {filews} /var/www/html/")
        elif(option=="3"):
            os.system(f"systemctl restart httpd")  
        elif(option=="4"):
            os.system(f"systemctl stop httpd")   
        elif(option=="5"):
            print("Exiting WebServer Menu\n\n..............Please Wait..............")
            sleep(3)
            break
Exemplo n.º 26
0
def main(rows, cols, speed, debug, path):
    """ Main loop for evaluating. """
    print_figlet('Puzzles and Dragons Solver', font='slant', colors='CYAN')
    
    # Prevent PIL pollution.
    pil_logger = logging.getLogger('PIL')
    pil_logger.setLevel(logging.INFO)

    logging.basicConfig(
        stream=sys.stdout,
        level=logging.CRITICAL if not debug else logging.DEBUG,
        format='%(message)s'
    )

    if not debug:
        _non_verbose(rows, cols, speed, path)
    else:
        _debug(rows, cols, speed, path)
Exemplo n.º 27
0
def LVMMenu():
    while (1):
        pyfiglet.print_figlet("LVMMenu", font="slant")
        print("\n\n ")
        print("_______________________________")
        print("=>Welcome to LVM Configuration |")
        print("|1] Check Disk Information     |")
        print("|2] Create a Physical Volume   |")
        print("|3] Create a Volume Group      |")
        print("|4] Create, Format, Mount LVM  |")
        print("|5] Extend LVM                 |")
        print("|6] Exit                       |")
        print("|______________________________|")
        option = input("Select an option: ")
        if (option == "1"):
            os.system("fdisk -l")
        elif (option == "2"):
            disk_name = input(" disk name: ")
            os.system(f"pvcreate {disk_name}")
        elif (option == "3"):
            vgname = input("Name of the Volume Group: ")
            disks = input("List all the DiskNames ( with spaces ): ")
            os.system(f"vgcreate {vgname} {disks}")
        elif (option == "4"):
            vgname = input("Name of your Volume Group: ")
            lvmname = input("Name of your LVM: ")
            size = input("Enter the size: ")
            mount_point = input("Specify your Mount Point: ")
            os.system(f"lvcreate --size {size} --name {lvmname} {vgname}")
            os.system(f"mkfs.ext4 /dev/{vgname}/{lvmname}")
            os.system(f"mount /dev/{vgname}/{lvmname} {mount_point}")
        elif (option == "5"):
            vgname = input("List the name of your Volume Group: ")
            lvmname = input("List the name of your LVM: ")
            size = input("Size to be increased by? ")
            os.system(f"lvextend --size +{size} /dev/{vgname}/{lvmname}")
            os.system(f"resize2fs /dev/{vgname}/{lvmname}")
        elif (option == "6"):
            print(
                "Exiting LVM Menu...\n..............Please be patent.............."
            )
            sleep(2)
            break
Exemplo n.º 28
0
 def all():
     options, parser = banners.optparser()
     text = options.text
     if text == None:
         banners.case3()
     fonts = pyfiglet.FigletFont.getFonts()
     times = 1
     for i in fonts:
         print(get_colors.white() + f"[{times}] " +
               get_colors.randomize1() + " Font Name: " +
               get_colors.randomize2() + f"{i}")
         times += 1
         print(get_colors.white() + "[" + get_colors.yellow() + "T" +
               get_colors.white() + "]" + get_colors.randomize() +
               " Your Text: " + get_colors.randomize1() + f"{text}\n" +
               get_colors.pink() + "[" + get_colors.sharp_megento() + "+" +
               get_colors.pink() + "]" + get_colors.randomize2() +
               " Output: \n" + get_colors.randomize3())
         pyfiglet.print_figlet(text, i)
         print(get_colors.randomize() + "#" * 70 + get_colors.white())
Exemplo n.º 29
0
 def printIntro(project_name, excludes_orginal, expandedExcludes):
     # Print program information to user
     pyfiglet.print_figlet("VCS Analysis", font='slant')
     print("by Christoffer Nissen (ChristofferNissen)")
     print()
     print("Analyzing", url)
     print("Project Name:", project_name)
     print("Since:", since)
     print("To:", to)
     print("Total number of commits", count)
     print("Total number of merge commits", merges)
     print("Total number of authors", all_authors.__len__())
     print("Internal committers:", internal_authors.__len__())
     print("External committers:", external_authors.__len__())
     print("Specified exclude paths:")
     for ep in excludes_orginal:
         print('    ', ep)
     print("Expanded into:")
     for ep in expandedExcludes:
         print('    ', ep)
Exemplo n.º 30
0
def PingScan():
    pyfiglet.print_figlet("__________", font="standard", colors=colors1)
    cprint('[+] Do You want to enter IP or URL [ip/url] ------> ',
           'red',
           attrs=['bold'],
           end=' ')
    res = input()
    print()
    if (res == 'ip' or res == 'IP' or res == 'Ip'):
        cprint('[+] Input the IP to be Checked ------> ',
               'red',
               attrs=['bold'],
               end=' ')
        ip = input()
        print()
    else:
        cprint('[+] Input the URL to be Checked ------> ',
               'red',
               attrs=['bold'],
               end=' ')
        url = input()
        ip = gethostbyname(url)
        print()
    cprint('[+] No of Packets to Be Sent ------> ',
           'red',
           attrs=['bold'],
           end=' ')
    n = input()
    print()
    os.system(f'ping -c {n} {ip} > files/ping.txt')
    os.system('cat files/ping.txt | tail -2 | head -1')
    print()
    f = open('files/ping.txt', 'r')
    a = f.readlines()
    f.close()
    b = a[-2]
    c = b.split()
    if (c[3] == '0'):
        cprint('[+]   The System is Not Live   [+]', 'red', attrs=['bold'])
    else:
        cprint('[+]   The System is Live   [+]', 'red', attrs=['bold'])
Exemplo n.º 31
0
def main():
    pyfiglet.print_figlet("WAVEN DB DUMPER", font="Bubble")
    print("Author: Rohit Kaundal - Programmer / Tech Head ( Waven )")
    print("Date: 23 Feb 2019 10:32PM IST")
    print("=" * 35)
    doProcess = input("Start Dumping (Y/N): ")
    if doProcess.upper() == 'N':
        print("Aborting dumping...")
        time.sleep(3)
        return -1

    print("[+] Starting Waven CSV File Dumper")
    DumpStrainData()
    print("=" * 35)
    sys.stdout.flush()
    time.sleep(1)
    DumpProductsData()
    print("=" * 35)
    print("Dumping Complete !")
    sys.stdout.flush()
    time.sleep(1)
Exemplo n.º 32
0
def print_data(mandatoryTasks, optionaltasks, pastduetasks, taskController):
    # Printing Tasks
    colorMandatory = "255;2;151:"
    colorOptional = "2;255;232:"
    colorPastdue = "255;255;255:"

    mandatoryTasksStr = []
    for task in mandatoryTasks:
        mandatoryTasksStr.append(task.get_list_print_data())

    optionalTasksStr = []
    for task in optionaltasks:
        optionalTasksStr.append(task.get_list_print_data())

    pastdueTasksStr = []
    for task in pastduetasks:
        pastdueTasksStr.append(task.get_list_print_data())

    print_figlet("Mandatory", font="slant", colors=colorMandatory)
    taskController.print_task_table(mandatoryTasksStr)

    print_figlet("Optional", font="slant", colors=colorOptional)
    taskController.print_task_table(optionalTasksStr)

    print_figlet("Past-Due", font="slant", colors=colorPastdue)
    taskController.print_task_table(pastdueTasksStr)

    print("")

    today = date.today()
    dateStr = today.strftime("%d-%B-%Y")
    cowsay.tux("Current Date : " + dateStr)
Exemplo n.º 33
0
def splashMessage(message, muffleClear=False):
    if not muffleClear:
        os.system("clear")
    pyfiglet.print_figlet(message)
    print ""