当前位置: 首页>>代码示例>>Python>>正文


Python Style.BRIGHT属性代码示例

本文整理汇总了Python中colorama.Style.BRIGHT属性的典型用法代码示例。如果您正苦于以下问题:Python Style.BRIGHT属性的具体用法?Python Style.BRIGHT怎么用?Python Style.BRIGHT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在colorama.Style的用法示例。


在下文中一共展示了Style.BRIGHT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: print_subreddits

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def print_subreddits(self, parser, reddit, search_for):
        print("\nChecking if Subreddit(s) exist...")
        subs, not_subs = self._find_subs(parser, reddit, search_for)

        if subs:
            print("\nThe following Subreddits were found and will be scraped:")
            print("-" * 56)
            print(*subs, sep = "\n")
        if not_subs:
            print("\nThe following Subreddits were not found and will be skipped:")
            print("-" * 60)
            print(*not_subs, sep = "\n")

        if not subs:
            print(Fore.RED + Style.BRIGHT + "\nNo Subreddits to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return subs 
开发者ID:JosephLai241,项目名称:URS,代码行数:21,代码来源:Basic.py

示例2: get_subreddits

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def get_subreddits(self, parser, reddit):
        subreddit_prompt = Style.BRIGHT + """
Enter Subreddit or a list of Subreddits (separated by a space) to scrape:

""" + Style.RESET_ALL

        while True:
            try:
                search_for = str(input(subreddit_prompt))
                if not search_for:
                    raise ValueError
                return PrintSubs().print_subreddits(parser, reddit, search_for)
            except ValueError:
                print("No Subreddits were specified! Try again.")

    ### Update Subreddit settings in master dictionary. 
开发者ID:JosephLai241,项目名称:URS,代码行数:18,代码来源:Basic.py

示例3: get_settings

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def get_settings(self, master, subs):
        for sub in subs:
            while True:
                try:
                    cat_i = int(input((Style.BRIGHT + """
Select a category to display for r/%s
-------------------
    0: Hot
    1: New
    2: Controversial
    3: Top
    4: Rising
    5: Search
-------------------
        """ + Style.RESET_ALL) % sub))

                    if cat_i == 5:
                        print("\nSelected search")
                        self._get_search(cat_i, master, sub)
                    else:
                        print("\nSelected category: %s" % self._categories[cat_i])
                        self._get_n_results(cat_i, master, sub)
                    break
                except (IndexError, ValueError):
                    print("Not an option! Try again.") 
开发者ID:JosephLai241,项目名称:URS,代码行数:27,代码来源:Basic.py

示例4: confirm_subreddits

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def confirm_subreddits(subs, parser):
        while True:
            try:
                confirm = input("\nConfirm selection? [Y/N] ").strip().lower()
                if confirm == options[0]:
                    subs = [sub for sub in subs]
                    return subs
                elif confirm not in options:
                    raise ValueError
                else:
                    print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
                    parser.exit()
            except ValueError:
                print("Not an option! Try again.")    

    ### Scrape again? 
开发者ID:JosephLai241,项目名称:URS,代码行数:18,代码来源:Basic.py

示例5: run

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def run(args, parser, reddit):
        Titles.Titles.b_title()
        
        while True:
            while True:                
                master = RunBasic._create_settings(parser, reddit)

                confirm = RunBasic._print_confirm(args, master)
                if confirm == options[0]:
                    break
                else:
                    print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
                    parser.exit()
            
            Subreddit.GetSortWrite().gsw(args, reddit, master)
            
            repeat = ConfirmInput.another()
            if repeat == options[1]:
                print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
                break 
开发者ID:JosephLai241,项目名称:URS,代码行数:22,代码来源:Basic.py

示例6: list_submissions

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def list_submissions(reddit, post_list, parser):
        print("\nChecking if post(s) exist...")
        posts, not_posts = Validation.Validation.existence(s_t[2], post_list, parser, reddit, s_t)
        
        if not_posts:
            print(Fore.YELLOW + Style.BRIGHT + 
                "\nThe following posts were not found and will be skipped:")
            print(Fore.YELLOW + Style.BRIGHT + "-" * 55)
            print(*not_posts, sep = "\n")

        if not posts:
            print(Fore.RED + Style.BRIGHT + "\nNo submissions to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return posts 
开发者ID:JosephLai241,项目名称:URS,代码行数:18,代码来源:Comments.py

示例7: list_redditors

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def list_redditors(parser, reddit, user_list):
        print("\nChecking if Redditor(s) exist...")
        users, not_users = Validation.Validation.existence(s_t[1], user_list, parser, reddit, s_t)
        
        if not_users:
            print(Fore.YELLOW + Style.BRIGHT + 
                "\nThe following Redditors were not found and will be skipped:")
            print(Fore.YELLOW + Style.BRIGHT + "-" * 59)
            print(*not_users, sep = "\n")

        if not users:
            print(Fore.RED + Style.BRIGHT + "\nNo Redditors to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return users 
开发者ID:JosephLai241,项目名称:URS,代码行数:18,代码来源:Redditor.py

示例8: master_timer

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def master_timer(function):
        def wrapper(*args):
            logging.info("INITIALIZING URS.")
            logging.info("")

            start = time.time()
            
            try:
                function(*args)
            except KeyboardInterrupt:
                print(Style.BRIGHT + Fore.RED + "\n\nURS ABORTED BY USER.\n")
                logging.warning("")
                logging.warning("URS ABORTED BY USER.\n")
                quit()

            logging.info("URS COMPLETED SCRAPES IN %.2f SECONDS.\n" % \
                (time.time() - start))

        return wrapper 
开发者ID:JosephLai241,项目名称:URS,代码行数:21,代码来源:Logger.py

示例9: list_subreddits

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def list_subreddits(parser, reddit, s_t, sub_list):
        print("\nChecking if Subreddit(s) exist...")
        subs, not_subs = Validation.Validation().existence(s_t[0], sub_list, parser, reddit, s_t)
        
        if not_subs:
            print(Fore.YELLOW + Style.BRIGHT + 
                "\nThe following Subreddits were not found and will be skipped:")
            print(Fore.YELLOW + Style.BRIGHT + "-" * 60)
            print(*not_subs, sep = "\n")

        if not subs:
            print(Fore.RED + Style.BRIGHT + "\nNo Subreddits to scrape!")
            print(Fore.RED + Style.BRIGHT + "\nExiting.\n")
            quit()

        return subs 
开发者ID:JosephLai241,项目名称:URS,代码行数:18,代码来源:Subreddit.py

示例10: crimeflare

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def crimeflare(target):
    print_out(Fore.CYAN + "Scanning crimeflare database...")

    with open("data/ipout", "r") as ins:
        crimeFoundArray = []
        for line in ins:
            lineExploded = line.split(" ")
            if lineExploded[1] == args.target:
                crimeFoundArray.append(lineExploded[2])
            else:
                continue
    if (len(crimeFoundArray) != 0):
        for foundIp in crimeFoundArray:
            print_out(Style.BRIGHT + Fore.WHITE + "[FOUND:IP] " + Fore.GREEN + "" + foundIp.strip())
    else:
        print_out("Did not find anything.") 
开发者ID:m0rtem,项目名称:CloudFail,代码行数:18,代码来源:cloudfail.py

示例11: update

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def update():
    print_out(Fore.CYAN + "Just checking for updates, please wait...")
    print_out(Fore.CYAN + "Updating CloudFlare subnet...")
    if(args.tor == False):
        headers = {'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; it; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'}
        r = requests.get("https://www.cloudflare.com/ips-v4", headers=headers, cookies={'__cfduid': "d7c6a0ce9257406ea38be0156aa1ea7a21490639772"}, stream=True)
        with open('data/cf-subnet.txt', 'wb') as fd:
            for chunk in r.iter_content(4000):
                fd.write(chunk)
    else:
        print_out(Fore.RED + Style.BRIGHT+"Unable to fetch CloudFlare subnet while TOR is active")
    print_out(Fore.CYAN + "Updating Crimeflare database...")
    r = requests.get("http://crimeflare.net:83/domains/ipout.zip", stream=True)
    with open('data/ipout.zip', 'wb') as fd:
        for chunk in r.iter_content(4000):
            fd.write(chunk)
    zip_ref = zipfile.ZipFile("data/ipout.zip", 'r')
    zip_ref.extractall("data/")
    zip_ref.close()
    os.remove("data/ipout.zip")


# END FUNCTIONS 
开发者ID:m0rtem,项目名称:CloudFail,代码行数:25,代码来源:cloudfail.py

示例12: process_search

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def process_search(options):
    search_query = []
    search_query.extend([hex_pattern(val.replace(' ', '')) for val in options.hex])
    search_query.extend([ascii_pattern(val) for lst in options.a for val in lst])
    search_query.extend([wide_pattern(val) for lst in options.w for val in lst])

    result = BINOBJ.search(
        search_query, limit=options.limit, exact=options.exact, test=options.test)
    if 'error' in result:
        print(Style.BRIGHT + Fore.RED + result['error']['message'])
        return

    if 'stats' in result:
        show_stats_new(result['stats'], options.limit)

    if len(result['results']) == 0:
        return

#    if len(result['results']) >= options.limit:
#        print("Showing top {0} results:".format(options.limit))
#    else:
#        print("Results:")

    show_results(result['results'], pretty_print=options.pretty_print) 
开发者ID:binarlyhq,项目名称:binarly-query,代码行数:26,代码来源:binarly_query.py

示例13: print_line

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def print_line(message, level=1, category = None, title = None, status=False):
    sts = get_status(category, status)

    if sts == 'applied':
        color = Fore.GREEN
        pre = '[+] '
    elif sts == 'touse':
        color = Fore.YELLOW
        pre = '[+] '
    elif sts == 'toremove':
        color = Fore.RED
        pre = '[-] '
    else:
        color = ''
        pre = ''

    if title:
        print(' '*4*level + Style.BRIGHT + title + ': ' + Style.RESET_ALL + message)
    else:
        print(' '*4*level + color + Style.BRIGHT + pre + Fore.RESET + message) 
开发者ID:gildasio,项目名称:h2t,代码行数:22,代码来源:output.py

示例14: check_names

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def check_names(infile):    #Checking the path to the wordlist
	if os.path.exists(infile):
		if status_method:
			banner()    #calls the banner function
			checkasciiwolf()      #calls the sexy ASCII wolf wallpaper
			scan_start()
			statusfindAdmin() #calls the function that basically does the job
			print(Fore.RED + Style.BRIGHT + "\n[+] Rock bottom;\n" + Style.RESET_ALL)
		elif error_method:
			banner()
			checkasciiwolf()
			scan_start()
			findAdmin()
			print(Fore.RED + Style.BRIGHT + "\n[+] Rock bottom;\n" + Style.RESET_ALL)
	else: #in case wordlist cant be found
		banner()
		opts()
		print(Fore.RED + Style.BRIGHT + "[-] Invalid path to the wordlist. File could not be found.\n" + Style.RESET_ALL)
# THIS IS THE STATUS CODE METHOD 
开发者ID:MichaelDim02,项目名称:colloide,代码行数:21,代码来源:colloide.py

示例15: test_description

# 需要导入模块: from colorama import Style [as 别名]
# 或者: from colorama.Style import BRIGHT [as 别名]
def test_description(self):
        config = sb.objects.config.Config(name="test-project", description="A test project", version="0.1.0")
        sbParser = sb.systems.parsing.skeleParser.SkeleParser(config, "test")
        description = sbParser.desc

        expectedDescription = Style.BRIGHT + "Test Project" + Style.RESET_ALL + """
A test project
-----------------------------------
Version: 0.1.0
Environment: test
Skelebot Version: 6.6.6
-----------------------------------"""

        self.assertEqual(description, expectedDescription) 
开发者ID:carsdotcom,项目名称:skelebot,代码行数:16,代码来源:test_systems_parsing_skeleParser.py


注:本文中的colorama.Style.BRIGHT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。