Skip to content

Commit

Permalink
Upgrade to python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Revelstoke committed Feb 13, 2024
1 parent 374377e commit 63f13ff
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 52 deletions.
6 changes: 3 additions & 3 deletions button.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def __init__(self):
#Setup pins and board
gpio.setmode(gpio.BCM)
gpio.setup(22, gpio.IN, pull_up_down=gpio.PUD_UP)
gpio.setup(4, gpio.IN, pull_up_down=gpio.PUD_UP)
gpio.setup(17, gpio.IN, pull_up_down=gpio.PUD_UP)
gpio.setup(4, gpio.IN, pull_up_down=gpio.PUD_UP)
gpio.setup(17, gpio.IN, pull_up_down=gpio.PUD_UP)

#Put pins in variables
self.center_button = 22
Expand Down Expand Up @@ -92,4 +92,4 @@ def check(self):
while True:
test.first = ''
winner = test.poll()
print winner
print(winner)
4 changes: 2 additions & 2 deletions jeoparpy/game/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
See the "Customization" section of the README for details on how to
alter the resource files from which the game data is built.
"""
from gamedata import GameData
from gamestate import JeopGameState
from .gamedata import GameData
from .gamestate import JeopGameState
4 changes: 2 additions & 2 deletions jeoparpy/game/gamedata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"""
from sys import stderr

from constants import AMOUNTS_PATH, CATEGORIES_PATH, CLUES_PATH, PLAYERS_PATH
from jeopplayer import JeopPlayer
from .constants import AMOUNTS_PATH, CATEGORIES_PATH, CLUES_PATH, PLAYERS_PATH
from .jeopplayer import JeopPlayer
from ..config import SUBTRACT_ON_INCORRECT
from ..util import get_stripped_nonempty_file_lines, to_numeric

Expand Down
4 changes: 2 additions & 2 deletions jeoparpy/game/gamestate.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def set(self, state, **kwargs):
self.kwargs.update(kwargs)

if DEBUG and self.kwargs:
print 'State args set: {0}'.format(self.kwargs)
print('State args set: {0}'.format(self.kwargs))

def _verify_transition(self, newState):
"""
Expand Down Expand Up @@ -145,7 +145,7 @@ def state(self, val):
self.kwargs = {}

if DEBUG:
print "State change: {0}".format(self)
print("State change: {0}".format(self))

class JeopGameState(GameState):
"""
Expand Down
8 changes: 4 additions & 4 deletions jeoparpy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import os
import sys

from config import FPS_LIMIT, FULLSCREEN, SUBTRACT_ON_INCORRECT, SCREEN_SIZE
from constants import ANIMATIONEND, ANSWER_TIMEOUT, AUDIOEND, SKIP_INTRO_FLAG
from game import GameData, JeopGameState
from ui import Controller, do_congrats, do_credits, do_intro, do_scroll
from .config import FPS_LIMIT, FULLSCREEN, SUBTRACT_ON_INCORRECT, SCREEN_SIZE
from .constants import ANIMATIONEND, ANSWER_TIMEOUT, AUDIOEND, SKIP_INTRO_FLAG
from .game import GameData, JeopGameState
from .ui import Controller, do_congrats, do_credits, do_intro, do_scroll
import button

EVENTS_ALLOWED = (ANIMATIONEND, ANSWER_TIMEOUT,
Expand Down
6 changes: 3 additions & 3 deletions jeoparpy/selectMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import pygame, sys, os
from pygame.locals import *
from constants import ROOT_PATH
from config import DRIVE
from .constants import ROOT_PATH
from .config import DRIVE

pygame.init()

Expand Down Expand Up @@ -62,7 +62,7 @@ def get_options(self):
if self.games > 4:
self.games = 4
if self.games < 1:
print 'You must have a game in the /games directory!'
print('You must have a game in the /games directory!')
pygame.quit()
sys.exit()

Expand Down
10 changes: 5 additions & 5 deletions jeoparpy/ui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
CUSTOMIZATION:
See instructions in config.py and resmaps.py.
"""
from categoryscroll import do_scroll
from congrats import do_congrats
from controller import Controller
from credits import do_credits
from intro import do_intro
from .categoryscroll import do_scroll
from .congrats import do_congrats
from .controller import Controller
from .credits import do_credits
from .intro import do_intro
2 changes: 1 addition & 1 deletion jeoparpy/ui/audioplayer.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pygame

from resmaps import SOUNDS, CLUE_READS
from .resmaps import SOUNDS, CLUE_READS

###############################################################################
class AudioPlayer(object):
Expand Down
8 changes: 4 additions & 4 deletions jeoparpy/ui/categoryscroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

import pygame

from config import CATEGORY_HOLD_TIME
from constants import JEOP_BLUE
from resmaps import FONTS
from util import (autofit_text, BorderedBox, draw_centered_textblock,
from .config import CATEGORY_HOLD_TIME
from .constants import JEOP_BLUE
from .resmaps import FONTS
from .util import (autofit_text, BorderedBox, draw_centered_textblock,
get_anim_data, shadow_text)
from ..config import FPS_LIMIT
from ..util import chunker
Expand Down
6 changes: 3 additions & 3 deletions jeoparpy/ui/congrats.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"""
import pygame

from constants import JEOP_BLUE
from resmaps import FONTS
from util import scale
from .constants import JEOP_BLUE
from .resmaps import FONTS
from .util import scale

def do_congrats(screen, clock, winners, audioPlayer):
"""
Expand Down
6 changes: 3 additions & 3 deletions jeoparpy/ui/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""
import pygame

from audioplayer import JeopAudioPlayer
from maingame import Clue, GameBoard, OpenClueAnimation, PodiaPanel
from .audioplayer import JeopAudioPlayer
from .maingame import Clue, GameBoard, OpenClueAnimation, PodiaPanel
from ..config import DEBUG
from ..constants import AUDIOEND

Expand Down Expand Up @@ -68,7 +68,7 @@ def draw(self, screen):
for sfc in self._sfcs:
if sfc.dirty:
if DEBUG:
print 'draw %s' % type(sfc).__name__
print('draw %s' % type(sfc).__name__)

if isinstance(sfc, pygame.sprite.Sprite):
screen.blit(sfc.image, sfc.rect)
Expand Down
6 changes: 3 additions & 3 deletions jeoparpy/ui/credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import pygame
from pygame.locals import QUIT, KEYDOWN, K_q

from constants import JEOP_BLUE
from resmaps import FONTS, IMAGES
from util import get_anim_data, scale, shadow_text
from .constants import JEOP_BLUE
from .resmaps import FONTS, IMAGES
from .util import get_anim_data, scale, shadow_text

###############################################################################
class CreditLine(pygame.sprite.DirtySprite):
Expand Down
6 changes: 3 additions & 3 deletions jeoparpy/ui/intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import pygame
from pygame.locals import KEYDOWN, QUIT

from constants import JEOP_BLUE, RULES, SUBTITLE
from resmaps import FONTS, IMAGES
from util import (draw_centered_textblock, draw_textline, restrict_fontsize,
from .constants import JEOP_BLUE, RULES, SUBTITLE
from .resmaps import FONTS, IMAGES
from .util import (draw_centered_textblock, draw_textline, restrict_fontsize,
scale, shadow_text, wait_for_keypress)

###############################################################################
Expand Down
8 changes: 4 additions & 4 deletions jeoparpy/ui/maingame/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
JeoparPy, i.e. everything from when the main game board and podia appear
until the game is over and the congratulations screen appears.
"""
from clue import Clue
from clueanimation import OpenClueAnimation
from gameboard import GameBoard
from podiapanel import PodiaPanel
from .clue import Clue
from .clueanimation import OpenClueAnimation
from .gameboard import GameBoard
from .podiapanel import PodiaPanel
4 changes: 2 additions & 2 deletions jeoparpy/ui/maingame/clue.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"""
import pygame

from jeopgamesfc import JeopGameSurface
from util import Timer
from .jeopgamesfc import JeopGameSurface
from .util import Timer
from ..constants import JEOP_BLUE
from ..resmaps import FONTS, IMAGES
from ..util import (autofit_text, draw_centered_textblock, draw_textblock,
Expand Down
2 changes: 1 addition & 1 deletion jeoparpy/ui/maingame/gameboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import pygame

from jeopgamesfc import JeopGameSurface
from .jeopgamesfc import JeopGameSurface
from ..constants import JEOP_BLUE
from ..resmaps import FONTS
from ..util import (autofit_text, BorderedBox, draw_centered_textblock,
Expand Down
4 changes: 2 additions & 2 deletions jeoparpy/ui/maingame/podiapanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"""
import pygame

from jeopgamesfc import JeopGameSurface
from podium import Podium
from .jeopgamesfc import JeopGameSurface
from .podium import Podium
from ..resmaps import FONTS, IMAGES


Expand Down
4 changes: 2 additions & 2 deletions jeoparpy/ui/maingame/podium.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"""
import pygame

from jeopgamesfc import JeopGameSurface
from util import Timer
from .jeopgamesfc import JeopGameSurface
from .util import Timer
from ..constants import JEOP_BLUE
from ..resmaps import FONTS, IMAGES
from ..util import (autofit_text, draw_centered_textblock,
Expand Down
6 changes: 4 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
pygame==2.0.3
RPi.GPIO==0.7.1
pygame==2.5.2
RPi.GPIO==0.7.1
# GPIO Emulator
# RPi @ git+https://github.com/nosix/raspberry-gpio-emulator/@891462c30064141bca3e5d7aa7f4c46cca99a7eb
2 changes: 1 addition & 1 deletion start.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@

from jeoparpy.main import main
main(*flags)
print config.DRIVE
print(config.DRIVE)

0 comments on commit 63f13ff

Please sign in to comment.