changed some imports, blanked out all __init__.py files

This commit is contained in:
Nick Dyer 2021-05-29 21:42:33 -04:00
parent 4e7e37177b
commit af7a4f0a80
7 changed files with 19 additions and 27 deletions

6
.gitignore vendored
View File

@ -128,8 +128,8 @@ dmypy.json
# Pyre type checker # Pyre type checker
.pyre/ .pyre/
# Save file
/save.json
# pocket-friends compile script # pocket-friends compile script
/compile.bat /compile.bat
# save file
/pocket_friends/save.json

View File

@ -1 +0,0 @@
"""Imports classes for running the hardware."""

View File

@ -7,25 +7,19 @@ from pocket_friends.game_files.game import main as game_main
from pocket_friends.development.dev_menu import main as dev_menu_main from pocket_friends.development.dev_menu import main as dev_menu_main
def main(): if __name__ == "__main__":
enable_dev = False enable_dev = False
if __name__ == '__main__': # enable dev mode if --dev argument is passed
if len(sys.argv) > 0:
for args in sys.argv:
if args == '--dev':
enable_dev = True
# enable dev mode if --dev argument is passed if not enable_dev:
if len(sys.argv) > 0: game_main()
for args in sys.argv: else:
if args == '--dev': dev_menu_main()
enable_dev = True
if not enable_dev: pygame.quit()
game_main() sys.exit()
else:
dev_menu_main()
pygame.quit()
sys.exit()
if __name__ == "__main__":
main()

View File

@ -1 +0,0 @@
"""Initializes all classes needed for the development environment, and faking GPIO inputs."""

View File

@ -2,7 +2,7 @@
Module to test the GPIO input on the Raspberry Pi. Module to test the GPIO input on the Raspberry Pi.
""" """
from collections import deque from collections import deque
from pocket_friends.hardware.gpio_handler import Constants, GPIOHandler from ..hardware.gpio_handler import Constants, GPIOHandler
def button_test(): def button_test():

View File

@ -8,7 +8,7 @@ import pygame
import time import time
from .button_test import button_test from .button_test import button_test
from .menus import Menu from .menus import Menu
from pocket_friends.hardware.gpio_handler import GPIOHandler, Constants from ..hardware.gpio_handler import GPIOHandler, Constants
dev_version = '0.0.1' dev_version = '0.0.1'

View File

@ -7,7 +7,7 @@ import json
import os import os
import pygame import pygame
from pygame.locals import * from pygame.locals import *
from pocket_friends.hardware.gpio_handler import Constants, GPIOHandler from ..hardware.gpio_handler import Constants, GPIOHandler
version = '0.0.1' version = '0.0.1'
game_fps = 16 game_fps = 16
@ -33,7 +33,7 @@ class FileHandler:
""" """
Writes attributes of class to "save.json" file. Writes attributes of class to "save.json" file.
""" """
with open('save.json', 'w') as save_file: with open('pocket_friends/save.json', 'w') as save_file:
json.dump(self.attributes, save_file) json.dump(self.attributes, save_file)
save_file.close() save_file.close()