Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replace termcolor for colorama and bumps to version 1.0

  • Loading branch information...
commit e2b96dc9b9370ddffc1bd7fd5af83bf3876d9356 1 parent 41f2996
@jpscaletti jpscaletti authored
Showing with 25 additions and 9 deletions.
  1. +1 −1  requirements.txt
  2. +13 −0 upload.sh
  3. +11 −8 voodoo/__init__.py
View
2  requirements.txt
@@ -4,5 +4,5 @@
#
# pip install -r requirements.txt
+colorama
Jinja2>=2.4
-termcolor
View
13 upload.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+clear
+rm -rf __pycache__
+rm -rf tests/__pycache__
+rm -rf docs/build
+
+rm -rf build
+rm -rf dist
+rm -rf *.egg-info
+
+find . -name "*.pyc" -exec rm -rf {} \;
+find . -name ".DS_Store" -exec rm -rf {} \;
+python setup.py sdist upload
View
19 voodoo/__init__.py
@@ -18,10 +18,10 @@
import re
import jinja2
-from termcolor import colored
+from colorama import init, Fore, Back, Style
-__version__ = '0.9'
+__version__ = '1.0.0'
DEFAULT_DATA = {
@@ -40,13 +40,16 @@
}
-def formatm(action, msg='', color=None, on_color=None, attrs=None,
- indent=12):
- if attrs is None:
- attrs = ['bold']
+def formatm(action, msg='', color='', on_color='', bright=True, indent=12):
action = action.rjust(indent, ' ')
+ color = getattr(Fore, color.upper(), '')
+ on_color = getattr(Back, on_color.upper(), '')
+ style = Style.BRIGHT if bright else Style.DIM if bright is False else ''
+
lparts = [
- colored(action, color=color, on_color=on_color, attrs=attrs),
+ color, on_color, style,
+ action,
+ Fore.RESET, Back.RESET, Style.RESET_ALL,
' ',
msg,
]
@@ -156,7 +159,7 @@ def make_file(dst_path, ffolder, filename, content, options):
# An identical file already exists.
if content == read_from(final_path):
if not quiet:
- print formatm('identical', created_path, color='magenta', attrs=[])
+ print formatm('identical', created_path, color='cyan', bright=None)
return
# A different file already exists.
Please sign in to comment.
Something went wrong with that request. Please try again.