File: style.py

package info (click to toggle)
python-nubia 0.2.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 772 kB
  • sloc: python: 4,182; makefile: 9; sh: 1
file content (65 lines) | stat: -rw-r--r-- 2,329 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#

from prompt_toolkit.styles import (
    Style,
    merge_styles,
    style_from_pygments_cls,
    style_from_pygments_dict,
)
from pygments.styles.monokai import MonokaiStyle
from pygments.token import Name, Token

shell_style = merge_styles(
    [
        style_from_pygments_cls(MonokaiStyle),
        style_from_pygments_dict(
            {
                # Commands
                Name.Command: "#f2b44f",
                Name.SubCommand: "#f2c46f",
                Name.InvalidCommand: "bg:#ff0066 #000000",
                Name.Select: "#0000ff",
                Name.Query: "#d78700",
                Name.Key: "#ffffff",
                Name.Path: "#fff484",
                Name.Help: "#00aa00",
                Name.Exit: "#ff0066",
                # User input.
                Token: "#ff0066",
                # Prompt.
                Token.Username: "#884444",
                Token.At: "#00aa00",
                Token.Colon: "#00aa00",
                Token.Pound: "#00aa00",
                Token.Tier: "#ff0088",
                Token.Path: "#884444 underline",
                Token.RPrompt: "bg:#ff0066 #ffffff",
                # Toolbar Tokens
                Token.Toolbar: "#ffffff bg:#1c1c1c",
                Token.TestTier: "#ff0000 bg:#1c1c1c",
                Token.ProductionTier: "#ff0000 bg:#1c1c1c",
                Token.OfflineNodes: "#ff0000 bg:#1c1c1c",
                Token.NodesCount: "#ffffff bg:#1c1c1c",
                Token.Spacer: "#ffffff bg:#1c1c1c",
                # Alarms
                Token.MinorAlarm: "#0000ff bg:#1c1c1c",
                Token.MajorAlarm: "#d78700 bg:#1c1c1c",
                Token.CriticalAlarm: "#ff0000 bg:#1c1c1c",
                Token.AppendFailures: "#0000ff bg:#1c1c1c",
                # General
                Token.Good: "#ffffff bg:#10c010",
                Token.Bad: "#ffffff bg:#c01010",
                Token.Info: "#ffffff bg:#1010c0",
                Token.Warn: "#000000 bg:#c0c010",
            }
        ),
        Style.from_dict({"bottom-toolbar": "fg:#ffffff bg:#1c1c1c noinherit"}),
    ]
)