"Fossies" - the Fresh Open Source Software Archive

Member "backintime-1.2.0/common/bcolors.py" (27 Apr 2019, 1163 Bytes) of package /linux/privat/backintime-1.2.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "bcolors.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.1.24_vs_1.2.0.

    1 #!/usr/bin/env python3
    2 #    Copyright (C) 2015-2019 Germar Reitze
    3 #
    4 #    This program is free software; you can redistribute it and/or modify
    5 #    it under the terms of the GNU General Public License as published by
    6 #    the Free Software Foundation; either version 2 of the License, or
    7 #    (at your option) any later version.
    8 #
    9 #    This program is distributed in the hope that it will be useful,
   10 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 #    GNU General Public License for more details.
   13 #
   14 #    You should have received a copy of the GNU General Public License along
   15 #    with this program; if not, write to the Free Software Foundation, Inc.,
   16 #    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
   17 
   18 import sys
   19 
   20 if sys.stdout.isatty():
   21     HEADER = '\033[95m'
   22     OKBLUE = '\033[94m'
   23     OKGREEN = '\033[92m'
   24     WARNING = '\033[93m'
   25     FAIL = '\033[91m'
   26     ENDC = '\033[0m'
   27     BOLD = '\033[1m'
   28     UNDERLINE = '\033[4m'
   29 else:
   30     HEADER = ''
   31     OKBLUE = ''
   32     OKGREEN = ''
   33     WARNING = ''
   34     FAIL = ''
   35     ENDC = ''
   36     BOLD = ''
   37     UNDERLINE = ''