-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feat(constants): defines colors and symbols as constants
This commit introduces the constants module. There are redundant uses of many strings and symbols in the entire code base and this module puts them all in one place such that all existing and future code can refer these.
- Loading branch information
1 parent
63b975e
commit 32eab78
Showing
3 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 Rapyuta Robotics | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from riocli.constants.colors import Colors | ||
from riocli.constants.symbols import Symbols | ||
|
||
__all__ = [Colors, Symbols] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Copyright 2023 Rapyuta Robotics | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
from enum import Enum | ||
|
||
|
||
class Colors(str, Enum): | ||
""" | ||
Colors is a str enum based on the colors supported by click. | ||
https://github.com/pallets/click/blob/main/examples/colors/colors.py | ||
""" | ||
def __str__(self): | ||
return str(self.value).lower() | ||
|
||
BLACK = 'black' | ||
RED = 'red' | ||
GREEN = 'green' | ||
YELLOW = 'yellow' | ||
BLUE = 'blue' | ||
MAGENTA = 'magenta' | ||
CYAN = 'cyan' | ||
WHITE = 'white' | ||
BRIGHT_BLACK = 'bright_black' | ||
BRIGHT_RED = 'bright_red' | ||
BRIGHT_GREEN = 'bright_green' | ||
BRIGHT_YELLOW = 'bright_yellow' | ||
BRIGHT_BLUE = 'bright_blue' | ||
BRIGHT_MAGENTA = 'bright_magenta' | ||
BRIGHT_CYAN = 'bright_cyan' | ||
BRIGHT_WHITE = 'bright_white' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Copyright 2023 Rapyuta Robotics | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
class Symbols: | ||
INFO = '🛈' | ||
ERROR = '✘' | ||
SUCCESS = '✔' | ||
WARNING = '⚠' | ||
WAITING = '⧖' |