From 3f13cd84ea609ae3e19c480c295c639122d1050e Mon Sep 17 00:00:00 2001 From: Kevin Date: Mon, 29 Jun 2020 02:30:37 -0500 Subject: [PATCH] * Do not print border around quotes when the terminal is small --- src/onionrcommands/daemonlaunch/quotes.py | 2 +- src/onionrcommands/daemonlaunch/showlogo.py | 34 ++++++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/onionrcommands/daemonlaunch/quotes.py b/src/onionrcommands/daemonlaunch/quotes.py index fe801101..ec80f83a 100644 --- a/src/onionrcommands/daemonlaunch/quotes.py +++ b/src/onionrcommands/daemonlaunch/quotes.py @@ -7,7 +7,7 @@ QUOTES = [ ("Hack the Planet", ""), ("Study after study has show that human behavior changes when we know we’re being watched.\nUnder observation, we act less free, which means we effectively *are* less free.", - "Edward Snodwen"), + "Edward Snowdwen"), ("A revolution without dancing is a revolution not worth having", "V for Vendetta"), ("There can be no justice so long as laws are absolute. Even life itself is an exercise in exceptions", diff --git a/src/onionrcommands/daemonlaunch/showlogo.py b/src/onionrcommands/daemonlaunch/showlogo.py index a0956573..d301fbbf 100644 --- a/src/onionrcommands/daemonlaunch/showlogo.py +++ b/src/onionrcommands/daemonlaunch/showlogo.py @@ -2,21 +2,45 @@ Show nice logo """ +import os + import config import logger from .quotes import QUOTE from utils.boxprint import bordered from utils import logoheader +""" + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +""" + def show_logo(): logger.raw('', terminal=True) # print nice header thing :) if config.get('general.display_header', True): logoheader.header("") - if QUOTE[1]: - logger.info( - "\u001b[33m\033[F" + bordered(QUOTE[0] + '\n -' + QUOTE[1]), - terminal=True) + if os.get_terminal_size().columns >= 120: + if QUOTE[1]: # If there is an author to show for the quote + logger.info( + "\u001b[33m\033[F" + bordered(QUOTE[0] + '\n -' + QUOTE[1]), + terminal=True) + else: + logger.info("\u001b[33m\033[F" + bordered(QUOTE[0]), terminal=True) else: - logger.info("\u001b[33m\033[F" + bordered(QUOTE[0]), terminal=True) \ No newline at end of file + if QUOTE[1]: + logger.info("\u001b[33m\033[F" + QUOTE[0] + '\n -' + QUOTE[1], + terminal=True) + else: + logger.info("\u001b[33m\033[F" + QUOTE[0], terminal=True)