-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add filetype and css class options
- Loading branch information
Showing
12 changed files
with
217 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
__version__ = "0.4.1" | ||
|
||
from ._version import get_versions | ||
__version__ = get_versions()['version'] | ||
|
||
__version__ = get_versions()["version"] | ||
del get_versions |
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 |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import sys | ||
import click | ||
|
||
from .filter import emojificate | ||
from .defaults import DEFAULT_CSS_CLASS, DEFAULT_FILETYPE | ||
|
||
|
||
def display_help(): | ||
print("emojificate.py -- turns text with emoji into text with accessible emoji") | ||
@click.command() | ||
@click.argument("input_string") | ||
@click.option( | ||
"--filetype", help="File type for image (PNG, SVG)", default=DEFAULT_FILETYPE | ||
) | ||
@click.option( | ||
"--css-class", help="CSS class to use for images", default=DEFAULT_CSS_CLASS | ||
) | ||
def cli(input_string, filetype, css_class): | ||
"""emojificate.py -- turns text with emoji into text with accessible emoji""" | ||
print(emojificate(input_string, filetype=filetype.lower(), css_class=css_class)) | ||
|
||
|
||
if __name__ == "__main__": | ||
line = " ".join(sys.argv[1:]) | ||
if line: | ||
print(emojificate(line)) | ||
else: | ||
display_help() | ||
sys.exit(1) | ||
cli() |
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,4 @@ | ||
# Default settings | ||
|
||
DEFAULT_FILETYPE = "png" | ||
DEFAULT_CSS_CLASS = "emojificate" |
Oops, something went wrong.