Skip to content

Commit

Permalink
Merge enhancements from branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
robertpeteuil committed May 6, 2017
2 parents b9b0167 + 422ae53 commit 774e6f6
Show file tree
Hide file tree
Showing 13 changed files with 137 additions and 115 deletions.
4 changes: 2 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,12 @@ ignored-modules=
# List of classes names for which member attributes should not be checked
# (useful for classes with attributes dynamically set). This supports can work
# with qualified names.
ignored-classes=
ignored-classes=EC2R,sys.stdout

# List of members which are set dynamically and missed by pylint inference
# system, and so shouldn't trigger E1101 when accessed. Python regular
# expressions are accepted.
generated-members=
generated-members=isatty,Instance,Image


[VARIABLES]
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
include LICENSE
include LICENSE.txt
5 changes: 4 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ List, start, stop and ssh to AWS instances using Name, ID and wildcards
-----------------------------------------------------------------------


|TRAVIS| |AppVeyor| |Codacy Grade| |Codacy Cov| |PyPi release| |Py ver| |PyL|
|TRAVIS| |AppVeyor| |Codacy Grade| |Codacy Cov| |PyPi release| |lang| |PyL|

--------------

Expand Down Expand Up @@ -139,3 +139,6 @@ Details

.. |PyL| image:: https://img.shields.io/pypi/l/awss.svg
:target: https://pypi.python.org/pypi/awss/

.. |lang| image:: https://img.shields.io/badge/language-python-3572A5.svg
:target: https://github.com/robertpeteuil/aws-shortcuts
36 changes: 25 additions & 11 deletions awss/colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,39 @@
colorama.Fore.RED)
BLUE, CYAN, WHITE = (colorama.Fore.BLUE, colorama.Fore.CYAN,
colorama.Fore.WHITE)
BRIGHT, RESET = colorama.Style.BRIGHT, colorama.Fore.RESET
except ImportError: # pragma: no cover
# No colorama, fallback to no-color mode
GREEN = YELLOW = RED = BLUE = CYAN = WHITE = ''

# Create 'color theme' by aliasing color vars to vars that
# are imported and used by other modules.
# User can change colors used in modules by simply changing
# their assignment here, thus avoiding having to change
# the color var-name throughout the module.
C_NORM = WHITE
GREEN = YELLOW = RED = BLUE = CYAN = WHITE = BRIGHT = RESET = ''


C_NORM = RESET
C_HEAD = GREEN
C_HEAD2 = BLUE
C_TI = CYAN
C_TI2 = YELLOW
C_GOOD = GREEN
C_WARN = YELLOW
C_ERR = RED
"""Functionally titled vars as a psuedo color theme.
It's intended that modules will import and use these functionaly-named
vars instead of the color named vars.
This simplifies changing colors in the module using them. To change
a color, the corresponding functional var only needs to be changed to a
different color here. If direct color names are used, changes
require replacing all occurences of the color var being changed.
"""


# Color dictionary for setting color names for item status of commands
C_STAT = {"running": C_GOOD, "start": C_GOOD, "ssh": C_GOOD,
"stopped": C_ERR, "stop": C_ERR, "stopping": C_WARN,
"pending": C_WARN, "starting": C_WARN}
"pending": C_WARN, "starting": C_WARN,
"stopped": C_ERR, "stop": C_ERR, "stopping": C_ERR,
"shutting-down": C_ERR, "terminated": C_ERR}
"""Color dictionary for AWS EC2 instance status colors.
Any value encountered in the AWS data must be listed or a KeyError is
thrown in the function printing the color. EC2 status reference:
http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_InstanceState.html
"""
Loading

0 comments on commit 774e6f6

Please sign in to comment.