This repository has been archived by the owner on Jan 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of assorted hooks for status/contacts. Both are pulling mocked v…
…alues from the correct functions.
- Loading branch information
Showing
6 changed files
with
183 additions
and
17 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
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
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
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
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 @@ | ||
__author__ = 'gtaylor' |
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,29 @@ | ||
""" | ||
Various inter-organization standings functions and utilities. | ||
""" | ||
|
||
from src.daemons.server.ansi import ANSI_HI_CYAN, ANSI_HI_GREEN, ANSI_HI_WHITE, ANSI_NORMAL, ANSI_HI_YELLOW, ANSI_HI_RED | ||
|
||
|
||
def get_standing_value_cosmetics(standing_val): | ||
""" | ||
Given a standing value between 0.0 and 1.0, return a text label for the | ||
value and a color that may be optionally used. | ||
:param float standing_val: The standing value to return cosmetics for. | ||
:rtype: tuple | ||
:returns: A tuple in the format of (standing_name, standing_color). | ||
""" | ||
|
||
if standing_val >= 0.9: | ||
return "Allied", ANSI_HI_GREEN | ||
elif standing_val >= 0.75: | ||
return "Friendly", ANSI_HI_CYAN | ||
elif standing_val > 0.5: | ||
return "Cordial", ANSI_HI_WHITE | ||
elif standing_val == 0.5: | ||
return "Neutral", ANSI_NORMAL | ||
elif standing_val >= 0.45: | ||
return "Disliked", ANSI_HI_YELLOW | ||
else: | ||
return "Hated", ANSI_HI_RED |