Removed dead code

This commit is contained in:
Maximilian Giller 2019-03-17 20:25:49 +01:00
parent b1705941e8
commit 8686637271

View file

@ -31,8 +31,6 @@ class WeatherColumnDesign (DesignEntity):
self.__draw_icon__(self.forecast.icon)
self.__draw_info__(self.forecast.short_description)
#self.__draw_number_symbols__()
#self.__draw_numbers__(self.forecast)
self.__draw_numbers_text__(self.forecast)
def __draw_info__ (self, info):
@ -45,52 +43,6 @@ class WeatherColumnDesign (DesignEntity):
txt.pos = pos
self.draw_design(txt)
def __draw_number_symbols__ (self):
symbols = [ tempicon,
humicon,
windicon ]
ypos = numbers_x_ypos * self.size[0]
fontsize = fontsize_y * self.size[1]
line_spacing = (self.size[1] - ypos - len(symbols) * fontsize) / len(symbols)
line_height = fontsize + line_spacing
width = line_height
max_width = max_symbol_y_width * self.size[1]
if width > max_width:
width = max_width
size = (width, width)
pos = (0, ypos)
for index, symbol in enumerate(symbols):
sym_ypos = pos[1] + line_height * index
self.__draw_resized_image_at__(symbol, (0, sym_ypos), size)
def __draw_numbers__ (self, forecast):
temperature = forecast.air_temperature + " " + self.__get_unit__(("°C", "°F"))
humidity = forecast.air_humidity + "%"
windspeed = forecast.wind_speed + " " + self.__get_unit__(("km/h", "mph"))
numbers_list = [ [ temperature ],
[ humidity ],
[ windspeed ] ]
fontsize = fontsize_y * self.size[1]
ypadding = numbers_x_ypadding * self.size[0]
ypos = numbers_x_ypos * self.size[0]
line_spacing = (self.size[1] - ypos - len(numbers_list) * fontsize) / len(numbers_list)
symbol_width = fontsize + line_spacing
max_symbol_width = max_symbol_y_width * self.size[1]
if symbol_width > max_symbol_width:
symbol_width = max_symbol_width
xpos = symbol_width
pos = (xpos, ypos + ypadding)
size = (self.size[0] - pos[0], self.size[1] - pos[1])
table = TableTextDesign(size, numbers_list, fontsize=fontsize, line_spacing=line_spacing)
table.pos = pos
self.draw_design(table)
def __draw_numbers_text__ (self, forecast):
temperature = forecast.air_temperature + " " + self.__get_unit__(("°C", "°F"))
humidity = forecast.air_humidity + "%"