General: Rename file to match others.

This commit is contained in:
Dylan Araps 2017-06-27 18:16:54 +10:00
parent c2942fd431
commit 1ede83a018
3 changed files with 14 additions and 14 deletions

View File

@ -6,7 +6,7 @@ import subprocess
from pywal.settings import CACHE_DIR from pywal.settings import CACHE_DIR
from pywal import util from pywal import util
from pywal import format_color from pywal import format_colors
def save_colors(colors, export_file, message): def save_colors(colors, export_file, message):
@ -30,25 +30,25 @@ def reload_i3():
def export_colors(colors): def export_colors(colors):
"""Export colors in various formats.""" """Export colors in various formats."""
plain_colors = format_color.plain(colors) plain_colors = format_colors.plain(colors)
save_colors(plain_colors, "colors", "plain hex colors") save_colors(plain_colors, "colors", "plain hex colors")
# Shell based colors. # Shell based colors.
shell_colors = format_color.shell(colors) shell_colors = format_colors.shell(colors)
save_colors(shell_colors, "colors.sh", "shell variables") save_colors(shell_colors, "colors.sh", "shell variables")
# Web based colors. # Web based colors.
css_colors = format_color.css(colors) css_colors = format_colors.css(colors)
save_colors(css_colors, "colors.css", "css variables") save_colors(css_colors, "colors.css", "css variables")
scss_colors = format_color.scss(colors) scss_colors = format_colors.scss(colors)
save_colors(scss_colors, "colors.scss", "scss variables") save_colors(scss_colors, "colors.scss", "scss variables")
# Text editor based colors. # Text editor based colors.
putty_colors = format_color.putty(colors) putty_colors = format_colors.putty(colors)
save_colors(putty_colors, "colors-putty.reg", "putty theme") save_colors(putty_colors, "colors-putty.reg", "putty theme")
# X based colors. # X based colors.
xrdb_colors = format_color.xrdb(colors) xrdb_colors = format_colors.xrdb(colors)
save_colors(xrdb_colors, "xcolors", "xrdb colors") save_colors(xrdb_colors, "xcolors", "xrdb colors")
# i3 colors. # i3 colors.

View File

@ -1,7 +1,7 @@
"""Test format functions.""" """Test format functions."""
import unittest import unittest
from pywal import format_color from pywal import format_colors
from pywal import util from pywal import util
@ -14,32 +14,32 @@ class TestFormatColors(unittest.TestCase):
def test_plain(self): def test_plain(self):
"""> Convert colors to plain.""" """> Convert colors to plain."""
result = format_color.plain(COLORS) result = format_colors.plain(COLORS)
self.assertEqual(result[0], "#363442\n") self.assertEqual(result[0], "#363442\n")
def test_shell(self): def test_shell(self):
"""> Convert colors to shell variables.""" """> Convert colors to shell variables."""
result = format_color.shell(COLORS) result = format_colors.shell(COLORS)
self.assertEqual(result[0], "color0='#363442'\n") self.assertEqual(result[0], "color0='#363442'\n")
def test_css(self): def test_css(self):
"""> Convert colors to css variables.""" """> Convert colors to css variables."""
result = format_color.css(COLORS) result = format_colors.css(COLORS)
self.assertEqual(result[1], "\t--color0: #363442;\n") self.assertEqual(result[1], "\t--color0: #363442;\n")
def test_scss(self): def test_scss(self):
"""> Convert colors to scss variables.""" """> Convert colors to scss variables."""
result = format_color.scss(COLORS) result = format_colors.scss(COLORS)
self.assertEqual(result[0], "$color0: #363442;\n") self.assertEqual(result[0], "$color0: #363442;\n")
def test_putty(self): def test_putty(self):
"""> Convert colors to putty theme.""" """> Convert colors to putty theme."""
result = format_color.putty(COLORS) result = format_colors.putty(COLORS)
self.assertEqual(result[2], "\"colour0\"=\"54,52,66\"\n") self.assertEqual(result[2], "\"colour0\"=\"54,52,66\"\n")
def test_xrdb(self): def test_xrdb(self):
"""> Convert colors to putty theme.""" """> Convert colors to putty theme."""
result = format_color.xrdb(COLORS) result = format_colors.xrdb(COLORS)
self.assertEqual(result[6], "*.color0: #363442\n*color0: #363442\n") self.assertEqual(result[6], "*.color0: #363442\n*color0: #363442\n")