From 9587854303e66cba93738dac026e438cd3318673 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Thu, 20 Jul 2017 10:42:31 +1000 Subject: general: Start work on a proper api. --- pywal/__init__.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index 006f780..853433d 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -3,3 +3,34 @@ wal - Generate and change colorschemes on the fly. Created by Dylan Araps. """ from pywal.settings import __version__ # noqa: F401 +from pywal import magic +from pywal import reload +from pywal import sequences +from pywal import wallpaper + + +def create_palette(img): + """Create a palette and return it as a dict.""" + colors = magic.gen_colors(img) + colors = magic.sort_colors(img, colors) + return colors + + +def send_sequences(colors, vte): + """Send the sequences.""" + sequences.send_sequences(colors, vte) + + +def reload_env(): + """Reload the environment.""" + reload.reload_env() + + +def set_wallpaper(img): + """Set the wallpaper.""" + wallpaper.set_wallpaper(img) + + +# def reload_colors(vte): +# """Reload the colors.""" +# sequences.reload_colors(vte) -- cgit v1.2.3 From b8d6049aa89ae560efd03c2bdd3b372edd5392db Mon Sep 17 00:00:00 2001 From: dylan araps Date: Thu, 20 Jul 2017 12:57:57 +1000 Subject: api: Move api funtions to wal.py --- pywal/__init__.py | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index 853433d..02dbe37 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -2,35 +2,10 @@ wal - Generate and change colorschemes on the fly. Created by Dylan Araps. """ -from pywal.settings import __version__ # noqa: F401 -from pywal import magic -from pywal import reload -from pywal import sequences -from pywal import wallpaper - - -def create_palette(img): - """Create a palette and return it as a dict.""" - colors = magic.gen_colors(img) - colors = magic.sort_colors(img, colors) - return colors - - -def send_sequences(colors, vte): - """Send the sequences.""" - sequences.send_sequences(colors, vte) - - -def reload_env(): - """Reload the environment.""" - reload.reload_env() - - -def set_wallpaper(img): - """Set the wallpaper.""" - wallpaper.set_wallpaper(img) - - -# def reload_colors(vte): -# """Reload the colors.""" -# sequences.reload_colors(vte) +# flake8: noqa: F401 +from pywal.settings import __version__ +from pywal.wal import create_palette +from pywal.wal import get_image +from pywal.wal import reload_env +from pywal.wal import send_sequences +from pywal.wal import set_wallpaper -- cgit v1.2.3 From 88bdd9ab013bad324e1f3f4ad8516fd6d55ca312 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Thu, 20 Jul 2017 13:40:31 +1000 Subject: api: Use wal file in __main__.py --- pywal/__init__.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index 02dbe37..32f33af 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -5,7 +5,9 @@ Created by Dylan Araps. # flake8: noqa: F401 from pywal.settings import __version__ from pywal.wal import create_palette +from pywal.wal import export_all_templates from pywal.wal import get_image +from pywal.wal import reload_colors from pywal.wal import reload_env from pywal.wal import send_sequences from pywal.wal import set_wallpaper -- cgit v1.2.3 From 52cd5e5f1a7c972a593fe55a853afd43111531e9 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Thu, 20 Jul 2017 23:19:13 +1000 Subject: General: Unhardcode all CACHE_DIR and COLOR_COUNT usage. --- pywal/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index 32f33af..9de680e 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -3,7 +3,7 @@ wal - Generate and change colorschemes on the fly. Created by Dylan Araps. """ # flake8: noqa: F401 -from pywal.settings import __version__ +from pywal.wal import __version__ from pywal.wal import create_palette from pywal.wal import export_all_templates from pywal.wal import get_image -- cgit v1.2.3 From 6e39b78dc3a8ae6fc164f2fe26f6c0004d92dc41 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Jul 2017 17:46:40 +1000 Subject: general: Use __all__ in __init__.py --- pywal/__init__.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index 9de680e..52cedff 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -2,7 +2,6 @@ wal - Generate and change colorschemes on the fly. Created by Dylan Araps. """ -# flake8: noqa: F401 from pywal.wal import __version__ from pywal.wal import create_palette from pywal.wal import export_all_templates @@ -11,3 +10,14 @@ from pywal.wal import reload_colors from pywal.wal import reload_env from pywal.wal import send_sequences from pywal.wal import set_wallpaper + +__all__ = [ + "__version__", + "create_palette", + "export_all_templates", + "get_image", + "reload_colors", + "reload_env", + "send_sequences", + "set_wallpaper", +] -- cgit v1.2.3 From de47c1beaaa77ee6f50235daba735ccc98ad608c Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Jul 2017 22:26:49 +1000 Subject: api: Remove wal.py --- pywal/__init__.py | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index 52cedff..ec61c5c 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -1,15 +1,22 @@ """ -wal - Generate and change colorschemes on the fly. + '|| +... ... .... ... ... ... ... .... || + ||' || '|. | || || | '' .|| || + || | '|.| ||| ||| .|' || || + ||...' '| | | '|..'|' .||. + || .. | +'''' '' Created by Dylan Araps. """ -from pywal.wal import __version__ -from pywal.wal import create_palette -from pywal.wal import export_all_templates -from pywal.wal import get_image -from pywal.wal import reload_colors -from pywal.wal import reload_env -from pywal.wal import send_sequences -from pywal.wal import set_wallpaper + +from .settings import __version__ +from .colors import get as create_palette +from .image import get as get_image +from .reload import colors as reload_colors +from .reload import env as reload_env +from .sequences import send as send_sequences +from .template import export_all as export_all_templates +from .wallpaper import change as set_wallpaper __all__ = [ "__version__", -- cgit v1.2.3 From d1c2b8023de2585befc5b68e69ed6d0f3ee5d27e Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 22 Jul 2017 23:27:43 +1000 Subject: api: Add function to export individual templates. --- pywal/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index ec61c5c..4a850ca 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -15,13 +15,15 @@ from .image import get as get_image from .reload import colors as reload_colors from .reload import env as reload_env from .sequences import send as send_sequences -from .template import export_all as export_all_templates +from .template import export_all +from .template import export from .wallpaper import change as set_wallpaper __all__ = [ "__version__", "create_palette", - "export_all_templates", + "export_all", + "export", "get_image", "reload_colors", "reload_env", -- cgit v1.2.3 From 377cc7e68ce2576ad928fdd6efb40cabdf0f19dc Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sun, 23 Jul 2017 10:57:33 +1000 Subject: api: Changed export arguments. --- pywal/__init__.py | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'pywal/__init__.py') diff --git a/pywal/__init__.py b/pywal/__init__.py index 4a850ca..e9c0603 100644 --- a/pywal/__init__.py +++ b/pywal/__init__.py @@ -10,23 +10,19 @@ Created by Dylan Araps. """ from .settings import __version__ -from .colors import get as create_palette -from .image import get as get_image -from .reload import colors as reload_colors -from .reload import env as reload_env -from .sequences import send as send_sequences -from .template import export_all -from .template import export -from .wallpaper import change as set_wallpaper +from . import colors +from . import export +from . import image +from . import reload +from . import sequences +from . import wallpaper __all__ = [ "__version__", - "create_palette", - "export_all", + "colors", "export", - "get_image", - "reload_colors", - "reload_env", - "send_sequences", - "set_wallpaper", + "image", + "reload", + "sequences", + "wallpaper", ] -- cgit v1.2.3