Skip to content

Commit

Permalink
fixed crushing bug in 563
Browse files Browse the repository at this point in the history
  • Loading branch information
m4k5 committed Feb 17, 2018
1 parent c2dcf57 commit e0e5bbc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions bin/cardschooli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import sys

import matplotlib.pyplot as plt
from math import ceil
from PIL import Image, ImageDraw, ImageFont
from PyQt5.QtCore import QSize
from PyQt5.QtGui import QPixmap, QMovie, QIcon
Expand Down Expand Up @@ -260,7 +259,6 @@ def spiinCHANGE(self, newvalue):

windowWYKR.LIST_OF_GOD[windowWYKR.values][self.name] = newvalue


def comboCHANGE(self, value):
windowWYKR.LIST_OF_GOD[windowWYKR.colors][self.name] = value

Expand Down Expand Up @@ -306,6 +304,7 @@ def __init__(self):
self.X = 0
self.Y = 0
self.czyPer = False

def init_ui(self):
czyPol()
self.loadCOLORS()
Expand Down Expand Up @@ -448,6 +447,7 @@ def smaxim(self):
return self.maxim
else:
return 999

def AddNew(self):
if self.smaxim() > 0:
itemek = QListWidgetItem2()
Expand Down Expand Up @@ -497,6 +497,7 @@ def get_value(self):
'Podaj wartość elementu na wykresie (q) : ', 1, 1, 999999999, 1)
if ok_pressed:
return i

def get_size(self):
i, ok_pressed0 = QInputDialog.getInt(self, 'SZEROKOŚĆ',
'Podaj szerokość diagramu. \n(piksele)',
Expand Down Expand Up @@ -546,6 +547,7 @@ def suma(self):

else:
return 100.0

def get_color(self):
if not self.czyP:
self.List_of_colors = self.list_of_colors
Expand All @@ -558,12 +560,9 @@ def get_color(self):
return item

def adding_chart(self, coords):

"""
imported = Image.open(os.path.join(os.pardir, "cards", window0.project, "wykres.png"))
imported = os.path.join(os.pardir, "cards", window0.project, "wykres.png")
window3.card.paste_in_ave(imported, coords)
window3.update_preview()
"""

def calculate(self, names):
dlugosci = []
Expand Down Expand Up @@ -648,6 +647,8 @@ def generating_chart(self, LIST_OF_GOD, size):
autopct='%1.1f%%', shadow=True, startangle=140)
plt.axis('equal')
plt.savefig(os.path.join(os.pardir, "cards", window0.project, "wykresOLD.png"))


class Window3(QWidget):
"""
user generates his card averse
Expand Down Expand Up @@ -988,6 +989,7 @@ def add_text_ave(self, coords, text, fill=None, font=None, size=None):
self.prev_ave_draw.text(coords, text, fill, font)
self.preview_ave()


def center(window):
qr = window.frameGeometry()

Expand Down

0 comments on commit e0e5bbc

Please sign in to comment.