Skip to content

Commit

Permalink
se comentó pygame para evitar warnings en test
Browse files Browse the repository at this point in the history
  • Loading branch information
ezeluduena committed Nov 8, 2023
1 parent 8b0fa1d commit fbfe143
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from app.routers.games import games
from app.routers.cards import cards
from app.routers.websockets import websockets
from .utils import show_initial_image
import threading
# from .utils import show_initial_image
# import threading

app = FastAPI()

Expand All @@ -26,5 +26,5 @@
app.include_router(websockets.router)

# This displays the initial image with the sound
t = threading.Thread(target=show_initial_image)
# t = threading.Thread(target=show_initial_image)
# t.start()
56 changes: 28 additions & 28 deletions app/utils.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
import os
import pygame
import time
# import os
# import pygame
# import time


def show_initial_image():
# Path of the image I want to display
image_path = "./app/resources/stay_away.png"
# def show_initial_image():
# # Path of the image I want to display
# image_path = "./app/resources/stay_away.png"

# Path of the audio file
audio_path = "./app/resources/stay_away.mp3"
# # Path of the audio file
# audio_path = "./app/resources/stay_away.mp3"

# pygame configuration
pygame.init()
window = pygame.display.set_mode((400, 300), pygame.NOFRAME)
# # pygame configuration
# pygame.init()
# window = pygame.display.set_mode((400, 300), pygame.NOFRAME)

# Load the image
image = pygame.image.load(image_path)
# # Load the image
# image = pygame.image.load(image_path)

# Get the width and height of the window
window_width, window_height = window.get_size()
# # Get the width and height of the window
# window_width, window_height = window.get_size()

# Scale the image to the size of the window
image = pygame.transform.scale(image, (window_width, window_height))
# # Scale the image to the size of the window
# image = pygame.transform.scale(image, (window_width, window_height))

# Show the image in the window
window.blit(image, (0, 0))
pygame.display.flip()
# # Show the image in the window
# window.blit(image, (0, 0))
# pygame.display.flip()

# Play audio file
pygame.mixer.init()
pygame.mixer.music.load(audio_path)
pygame.mixer.music.play()
# # Play audio file
# pygame.mixer.init()
# pygame.mixer.music.load(audio_path)
# pygame.mixer.music.play()

# Wait 6 seconds
time.sleep(6)
# # Wait 6 seconds
# time.sleep(6)

# Close the window
pygame.quit()
# # Close the window
# pygame.quit()

0 comments on commit fbfe143

Please sign in to comment.