No longer need .ansible-lint
All checks were successful
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora) (push) Successful in 9s
All checks were successful
Ansible Code Pipeline / Ansible-Development-Pipeline (ansible-dev-fedora) (push) Successful in 9s
This commit is contained in:
@ -1,5 +0,0 @@
|
|||||||
skip_list:
|
|
||||||
- yaml[colons]
|
|
||||||
- yaml[empty-lines]
|
|
||||||
- yaml[line-length]
|
|
||||||
- no-changed-when
|
|
@ -23,6 +23,7 @@
|
|||||||
- name: Verify mount status
|
- name: Verify mount status
|
||||||
ansible.builtin.command: "ls {{ item }}"
|
ansible.builtin.command: "ls {{ item }}"
|
||||||
timeout: 5
|
timeout: 5
|
||||||
|
changed_when: false
|
||||||
register: r_verify_mounts
|
register: r_verify_mounts
|
||||||
loop: "{{ nfs_mount_list }}"
|
loop: "{{ nfs_mount_list }}"
|
||||||
loop_control:
|
loop_control:
|
||||||
@ -36,6 +37,7 @@
|
|||||||
|
|
||||||
- name: Lazily unmount the failed shares
|
- name: Lazily unmount the failed shares
|
||||||
ansible.builtin.command: "umount -f -l {{ item }}"
|
ansible.builtin.command: "umount -f -l {{ item }}"
|
||||||
|
changed_when: false
|
||||||
register: r_lazy_unmount
|
register: r_lazy_unmount
|
||||||
async: 30
|
async: 30
|
||||||
poll: 0
|
poll: 0
|
||||||
|
53
pil.py
Normal file
53
pil.py
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
from PIL import Image, ImageDraw, ImageFont
|
||||||
|
import random
|
||||||
|
|
||||||
|
def generate_freeform_image(user_input, width=800, height=600, output_path="generated_image.png"):
|
||||||
|
"""
|
||||||
|
Generates a freeform abstract image based on user input.
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- user_input (str): A theme, mood, or keyword to inspire the design.
|
||||||
|
- width (int): Width of the image.
|
||||||
|
- height (int): Height of the image.
|
||||||
|
- output_path (str): File path to save the image.
|
||||||
|
"""
|
||||||
|
# Create a blank canvas
|
||||||
|
image = Image.new("RGB", (width, height), color="white")
|
||||||
|
draw = ImageDraw.Draw(image)
|
||||||
|
|
||||||
|
# Define color palette based on mood
|
||||||
|
mood_colors = {
|
||||||
|
"happy": ["#FFD700", "#FF69B4", "#ADFF2F"],
|
||||||
|
"calm": ["#ADD8E6", "#87CEFA", "#B0E0E6"],
|
||||||
|
"dark": ["#2F4F4F", "#000000", "#4B0082"],
|
||||||
|
"energetic": ["#FF4500", "#FF6347", "#FFFF00"],
|
||||||
|
"mystical": ["#8A2BE2", "#4B0082", "#00CED1"]
|
||||||
|
}
|
||||||
|
|
||||||
|
# Pick colors based on input
|
||||||
|
selected_colors = mood_colors.get(user_input.lower(), ["#CCCCCC", "#999999", "#666666"])
|
||||||
|
|
||||||
|
# Draw random shapes
|
||||||
|
for _ in range(50):
|
||||||
|
shape_type = random.choice(["ellipse", "rectangle", "line"])
|
||||||
|
x1, y1 = random.randint(0, width), random.randint(0, height)
|
||||||
|
x2, y2 = random.randint(0, width), random.randint(0, height)
|
||||||
|
color = random.choice(selected_colors)
|
||||||
|
|
||||||
|
if shape_type == "ellipse":
|
||||||
|
draw.ellipse([x1, y1, x2, y2], fill=color, outline=None)
|
||||||
|
elif shape_type == "rectangle":
|
||||||
|
draw.rectangle([x1, y1, x2, y2], fill=color, outline=None)
|
||||||
|
elif shape_type == "line":
|
||||||
|
draw.line([x1, y1, x2, y2], fill=color, width=random.randint(1, 5))
|
||||||
|
|
||||||
|
# Optionally add text
|
||||||
|
try:
|
||||||
|
font = ImageFont.truetype("arial.ttf", 24)
|
||||||
|
draw.text((10, 10), f"Inspired by: {user_input}", fill="black", font=font)
|
||||||
|
except:
|
||||||
|
draw.text((10, 10), f"Inspired by: {user_input}", fill="black")
|
||||||
|
|
||||||
|
# Save the image
|
||||||
|
image.save(output_path)
|
||||||
|
print(f"Image saved to {output_path}")
|
Reference in New Issue
Block a user