Tidy up
parent
35d9ce13f2
commit
b019aa2f28
|
@ -1,13 +1,10 @@
|
|||
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor, QFont
|
||||
from PyQt5.QtWidgets import (QSizePolicy, QGraphicsWidget, QGraphicsItem,
|
||||
QGraphicsLineItem, QGraphicsRectItem, QGraphicsObject,
|
||||
QGraphicsItemGroup, QGraphicsPathItem, QGraphicsLinearLayout)
|
||||
from PyQt5.QtCore import (QAbstractAnimation, QObject, QPointF, Qt, QRectF, QLineF,
|
||||
QPropertyAnimation, pyqtProperty, pyqtSignal, QSizeF)
|
||||
from PyQt5.QtGui import QPen
|
||||
from PyQt5.QtWidgets import QSizePolicy, QGraphicsWidget
|
||||
from PyQt5.QtCore import (QAbstractAnimation, Qt, QLineF, QPropertyAnimation, pyqtProperty,
|
||||
pyqtSignal, QSizeF)
|
||||
|
||||
from . import sudoku_graphics as sdk_grap
|
||||
from . import menu_graphics as menu_grap
|
||||
from general import extras
|
||||
|
||||
|
||||
class BoxBoard(QGraphicsWidget):
|
||||
|
@ -67,7 +64,6 @@ class BoxBoard(QGraphicsWidget):
|
|||
for line in self.line_order:
|
||||
if line.length() > 1:
|
||||
painter.drawLine(line)
|
||||
#super().paint(painter, style, widget)
|
||||
|
||||
# Defining the length to be drawn as a pyqtProperty
|
||||
@pyqtProperty(float)
|
||||
|
|
|
@ -2,18 +2,16 @@
|
|||
This module contains all kinds of animated buttons
|
||||
"""
|
||||
|
||||
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor, QFont
|
||||
from PyQt5.Qt import QApplication, QTimer
|
||||
from PyQt5.QtWidgets import (QGraphicsScene, QGraphicsView, QGraphicsItem,
|
||||
QGraphicsLineItem, QGraphicsRectItem, QGraphicsObject,
|
||||
QGraphicsItemGroup, QGraphicsPathItem)
|
||||
from PyQt5.QtCore import (QAbstractAnimation, QObject, QPointF, Qt, QRectF, QLineF,
|
||||
QPropertyAnimation, pyqtProperty, pyqtSignal)
|
||||
from general import extras
|
||||
import sys
|
||||
import math
|
||||
import random
|
||||
|
||||
from PyQt5.QtCore import (QAbstractAnimation, Qt, QRectF, QLineF,
|
||||
QPropertyAnimation, pyqtProperty, pyqtSignal)
|
||||
from PyQt5.QtGui import QPen
|
||||
from PyQt5.QtWidgets import (QGraphicsObject)
|
||||
|
||||
from general import extras
|
||||
|
||||
RANDOMCHAR = "~!@#$%^&*()_+`-=[]\{}|;:'<>,./?\""
|
||||
|
||||
|
||||
|
|
|
@ -2,15 +2,15 @@
|
|||
This module contains the components that make up the menu Board
|
||||
"""
|
||||
|
||||
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor, QFont
|
||||
from PyQt5.QtWidgets import (QSizePolicy, QGraphicsWidget, QGraphicsItem,
|
||||
QGraphicsLineItem, QGraphicsRectItem, QGraphicsObject, QGraphicsProxyWidget,
|
||||
QGraphicsLinearLayout, QGraphicsLayoutItem, QGraphicsScene, QGraphicsView,)
|
||||
from PyQt5.QtCore import (QAbstractAnimation, QObject, QPointF, Qt, QRectF, QLineF,
|
||||
QPropertyAnimation, pyqtProperty, pyqtSignal, QSizeF, QTimer)
|
||||
from PyQt5.Qt import QApplication
|
||||
|
||||
import sys
|
||||
|
||||
from PyQt5.Qt import QApplication
|
||||
from PyQt5.QtCore import (Qt, QRectF, pyqtSignal, QSizeF, QTimer)
|
||||
from PyQt5.QtGui import QPainter, QBrush, QPen
|
||||
from PyQt5.QtWidgets import (QSizePolicy, QGraphicsWidget, QGraphicsItem,
|
||||
QGraphicsObject, QGraphicsProxyWidget,
|
||||
QGraphicsScene, QGraphicsView, )
|
||||
|
||||
if __name__ == "__main__":
|
||||
import buttons
|
||||
import scoreboard as scb
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor, QFont
|
||||
from PyQt5.QtWidgets import (QWidget, QLineEdit, QHBoxLayout, QGridLayout, QVBoxLayout, QSizePolicy,
|
||||
QPushButton, QLabel)
|
||||
from PyQt5.QtCore import (QAbstractAnimation, QObject, QPointF, Qt, QRectF, QLineF,
|
||||
QPropertyAnimation, pyqtProperty, pyqtSignal, QSizeF, QTimer)
|
||||
from PyQt5.Qt import QApplication
|
||||
import sys
|
||||
import random
|
||||
import sys
|
||||
|
||||
from PyQt5.Qt import QApplication
|
||||
from PyQt5.QtCore import (QAbstractAnimation, Qt, QPropertyAnimation, pyqtProperty, pyqtSignal, QTimer)
|
||||
from PyQt5.QtWidgets import (QWidget, QLineEdit, QHBoxLayout, QGridLayout, QVBoxLayout, QPushButton, QLabel)
|
||||
|
||||
if not __name__ == "__main__":
|
||||
sys.path.append("~/PycharmProjects/sudoku")
|
||||
hs_file = "/home/eyt21/PycharmProjects/sudoku/general/highscore.txt"
|
||||
else:
|
||||
hs_file = "./sudoku/general/highscore.txt"
|
||||
|
||||
from general import highscore as hs
|
||||
|
||||
|
@ -150,7 +151,7 @@ class ScoreGrid(QGridLayout):
|
|||
def __init__(self):
|
||||
super().__init__()
|
||||
try:
|
||||
self.highscore_list = hs.read_highscore_file("/home/eyt21/PycharmProjects/sudoku/general/highscore.txt")
|
||||
self.highscore_list = hs.read_highscore_file(hs_file)
|
||||
except Exception as e:
|
||||
print('Cannot open file', e)
|
||||
|
||||
|
|
|
@ -2,18 +2,17 @@
|
|||
This module contains the components that make up the Sudoku Board
|
||||
"""
|
||||
|
||||
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor, QFont
|
||||
from PyQt5.QtWidgets import QGraphicsItem, QGraphicsObject
|
||||
import numpy as np
|
||||
from PyQt5.QtCore import (QAbstractAnimation, QPointF, Qt, QRectF, QLineF,
|
||||
QPropertyAnimation, pyqtProperty, pyqtSignal)
|
||||
from PyQt5.QtGui import QPen, QFont
|
||||
from PyQt5.QtWidgets import QGraphicsItem, QGraphicsObject
|
||||
|
||||
from gameplay import sudoku_gameplay as sdk
|
||||
from general.extras import bound_value
|
||||
from . import buttons
|
||||
from . import menu_graphics as menu_grap
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
class BaseSudokuItem(QGraphicsObject):
|
||||
|
||||
|
|
11
main.py
11
main.py
|
@ -1,10 +1,7 @@
|
|||
from PyQt5.QtGui import QPainter, QBrush, QPen, QColor, QFont, QTransform, QWheelEvent
|
||||
from PyQt5.Qt import QApplication, QTimer
|
||||
from PyQt5.QtWidgets import (QGraphicsScene, QGraphicsView, QGraphicsItem,
|
||||
QGraphicsLineItem, QGraphicsRectItem, QGraphicsObject,
|
||||
QGraphicsItemGroup, QGraphicsWidget, QGraphicsLinearLayout)
|
||||
from PyQt5.QtCore import (QAbstractAnimation, QObject, QPoint, QPointF, Qt, QRectF,QLineF,
|
||||
QPropertyAnimation, pyqtProperty, pyqtSignal)
|
||||
from PyQt5.QtGui import QPainter, QBrush
|
||||
from PyQt5.Qt import QApplication
|
||||
from PyQt5.QtWidgets import QGraphicsScene, QGraphicsView, QGraphicsWidget, QGraphicsLinearLayout
|
||||
from PyQt5.QtCore import Qt
|
||||
import sys
|
||||
|
||||
from graphic_components import board
|
||||
|
|
Loading…
Reference in New Issue