import all
This commit is contained in:
commit
881baaa1ed
25 files changed
+1779
No files matched your search
@@ -0,0 +1,20 @@
|
||||
import subprocess
|
||||
|
||||
|
||||
def generate(text, font="smblock", filter_effect=None, colors=None):
|
||||
command = ["toilet", "-f", font]
|
||||
if filter_effect:
|
||||
command.extend(["-F", filter_effect])
|
||||
if colors:
|
||||
# Toilet uses a specific format for color arguments, e.g., --gay or --metal
|
||||
# For general colors, you might need to use specific filters or direct color codes.
|
||||
# This example focuses on filters that inherently use colors.
|
||||
pass # More complex color handling would be needed for arbitrary colors
|
||||
|
||||
command.append(text)
|
||||
|
||||
try:
|
||||
result = subprocess.run(command, capture_output=True, text=True, check=True)
|
||||
return result.stdout
|
||||
except subprocess.CalledProcessError as e:
|
||||
return f"Error executing toilet: {e}\n{e.stderr}"
|
||||
Reference in new issue
Block a user