本文整理汇总了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
示例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.
示例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.")
示例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?
示例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
示例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
示例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
示例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
示例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
示例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.")
示例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
示例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)
示例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)
示例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
示例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)