Python colorama.Back.MAGENTA Examples

The following are 4 code examples of colorama.Back.MAGENTA(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module colorama.Back , or try the search function .
Example #1
Source File: pretty_print.py    From cs224n-win18-squad with Apache License 2.0 5 votes vote down vote up
def magentaback(s):
    """Magenta background"""
    return Back.MAGENTA + s + Back.RESET 
Example #2
Source File: personality.py    From Jarvis with MIT License 5 votes vote down vote up
def __call__(self, jarvis, s):
        prompt = "{black}Q{Q_id} {cyan}{left} {black}--- {green}{right}"
        prompt_formatter = {
            'cyan': Fore.CYAN,
            'black': Fore.BLACK,
            'green': Fore.GREEN
        }
        jarvis.say("Start personality test..", color=Fore.BLACK)
        jarvis.say(self.instruction)
        for i, (Q_id, left, right) in enumerate(self.Q):
            prompt_formatter['Q_id'] = i
            prompt_formatter['left'] = left
            prompt_formatter['right'] = right

            jarvis.say(prompt.format(**prompt_formatter))
            user_input = jarvis.input_number(
                prompt="Enter your choice on the scale of 1-5:\n", rmin=1,
                rmax=5, color=Fore.BLUE, rtype=int)
            self.answers[Q_id] = user_input
        self.get_scores()

        jarvis.say(
            "{}Your personality is: {}{}{}{}".format(
                Fore.BLUE,
                Fore.BLACK,
                Back.MAGENTA,
                self.type,
                Style.RESET_ALL))
        jarvis.say(
            "Redirecting to your personality analysis\
                 in 3s...", color=Fore.BLUE)
        time.sleep(3)
        self.open_analysis() 
Example #3
Source File: helper.py    From PRET with GNU General Public License v2.0 5 votes vote down vote up
def recv(self, str, mode):
    if str: print(Back.MAGENTA + str + Style.RESET_ALL)
    if str and mode == 'hex':
      print(Fore.MAGENTA + conv().hex(str, ':') + Style.RESET_ALL)

  # show information 
Example #4
Source File: xmlrpc-bruteforcer.py    From xmlrpc-bruteforcer with Apache License 2.0 4 votes vote down vote up
def caller(self, proxy):
        """ Populate the XML-RPC system.multicall() with the maximum number of predefined
            of subrequests and then fire it. 
        """
        
        calls = 0
        global exit_flag

        pbar = tqdm(self.queue.qsize(), desc=self.name, total=self.queue.qsize(), unit='multicall', unit_scale=True, dynamic_ncols=True)

        while not self.queue.empty() and not exit_flag:
            chunks_size = self.queue.get()
            multicall = xmlrpc.client.MultiCall(proxy)

            for passwords in chunks_size:
                # Can be any other available method that needs auth.
                multicall.wp.getUsersBlogs(self.username, passwords.strip())

            try:
                if self.verbose:
                    pbar.write(Fore.MAGENTA + "[{}]".format(self.name) + TRAFFIC_OUT + "XML request [#{}]:".format(calls))
                    pbar.write("{}".format(chunks_size) + Style.RESET_ALL)
                
                res = multicall()
            except:
                pbar.write(ERROR + "could not make an XML-RPC call" + Style.RESET_ALL)
                continue

            if self.verbose:
                pbar.write(Back.MAGENTA + "[{}]".format(self.name) + TRAFFIC_IN + "XML response [#{}] (200 OK):".format(calls))
                pbar.write("{}".format(res.results) + Style.RESET_ALL)

            if re.search("isAdmin", str(res.results), re.MULTILINE):
                i = 0

                for item in res.results:
                    if re.search(r"'isAdmin': True", str(item)):
                        exit_flag = True    
                        # let time for the threads to terminate
                        time.sleep(2)
                    	# pbar.write() seems to be bugged at the moment
                        pbar.write(RESULT + "found a match: \"{0}:{1}\"".format(self.username, chunks_size[i].strip()) + Style.RESET_ALL)
                        # Log the password in case sys.stdout acts dodgy
                        with open("passpot.pot", "a+") as logfile:
                        	logfile.write("{0} - {1}:{2}\n".format(self.xmlrpc_intf, self.username, chunks_size[i].strip()))
                        break 

                    i += 1
            
            calls += 1
            self.queue.task_done()
            pbar.update()

        pbar.close()