ISISComputingGroup / ISISComputingGroup/IBEX

GUI genie_python: Create print colour command

Offen
#2,283 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
re-requested
Vorherrschende Sprache
Keine Sprachdaten
Sterne
6
Forks
2
Ø Merge
16 Std. 40 Min.
Gemergte PRs (30 T.)
2

Beschreibung

As a scientists I would like to colour the output from genie_python.

This is possible from by using the colours as per this snippet:

```
class AnsiColors:
FG_BLACK = '\033[30m'
FG_RED = '\033[31m'
FG_GREEN = '\033[32m'
FG_YELLOW = '\033[33m'
FG_BLUE = '\033[34m'
FG_MAGENTA = '\033[35m'
FG_CYAN = '\033[36m'
FG_WHITE = '\033[37m'
BG_BLACK = '\033[40m'
BG_RED = '\033[41m'
BG_GREEN = '\033[42m'
BG_YELLOW = '\033[43m'
BG_BLUE = '\033[44m'
BG_MAGENTA = '\033[45m'
BG_CYAN = '\033[46m'
BG_WHITE = '\033[47m'
END = '\033[0m'

for d in dir(AnsiColors):
if d.startswith("FG"):
print(getattr(AnsiColors, d) + d + AnsiColors.END)
if d.startswith("BG"):
print(getattr(AnsiColors, d) + d + AnsiColors.END)
```

We should create a command which could be called `colour_print(PrintColour.BLUE, "hi")`.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginnen Sie damit, die Befehlsschnittstelle von genie_python zu lokalisieren und das ANSI-Farbbeispiel im Issue zu prüfen. Implementieren Sie das angeforderte Verhalten von colour_print(PrintColour.BLUE, "hi") und überprüfen Sie, dass für die unterstützten Farben eine farbige Ausgabe erzeugt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.