Ejemplo n.º 1
0
 def parse_post_details(self, post_detail_html):
     soup = self.get_soup(post_detail_html)
     post_header = soup.select_one('div#post-header>h1').text
     post_content = soup.select_one('div.post-section')
     print('\n')
     print(Console.yellow(line(post_header)))
     print(post_header)
     print(Console.yellow(line(post_header)))
     print('\n')
     post_detail = post_content.text.strip()
     print(post_detail)
Ejemplo n.º 2
0
    def choose_to_delete(self, file_name):
        choice = input(
            Console.yellow(f'Do you wish to delete {file_name}? (N/y) > '))
        choice = choice.strip().lower()
        not_valid = choice not in ['n', 'y']
        if not_valid:
            Console.error('Please choose a valid input!')
            time.sleep(.2)
            self.choose_to_delete(file_name)

        if choice == 'n':
            Console.log('Bye!')
            return
        Console.info(f'Deleting {file_name}...')
        delete_file(file_name)