A console script that allows you to easily update multiple git repositories at once
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

26 Zeilen
794 B

  1. # -*- coding: utf-8 -*-
  2. #
  3. # Copyright (C) 2011-2014 Ben Kurtovic <ben.kurtovic@gmail.com>
  4. # See the LICENSE file for details.
  5. import re
  6. __all__ = ["out", "bold", "red", "green", "yellow", "blue"]
  7. # Text formatting functions:
  8. bold = lambda t: "\x1b[1m" + t + "\x1b[0m"
  9. red = lambda t: "\x1b[1m\x1b[31m" + t + "\x1b[0m"
  10. green = lambda t: "\x1b[1m\x1b[32m" + t + "\x1b[0m"
  11. yellow = lambda t: "\x1b[1m\x1b[33m" + t + "\x1b[0m"
  12. blue = lambda t: "\x1b[1m\x1b[34m" + t + "\x1b[0m"
  13. def out(indent, msg):
  14. """Print a message at a given indentation level."""
  15. width = 4 # Amount to indent at each level
  16. if indent == 0:
  17. spacing = "\n"
  18. else:
  19. spacing = " " * width * indent
  20. msg = re.sub(r"\s+", " ", msg) # Collapse multiple spaces into one
  21. print(spacing + msg)