Skip to content

Commit

Permalink
Bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-gil committed Nov 11, 2022
1 parent e14d653 commit 836f895
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tgbot/services/draw_weather_image.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""" Generates an image with weather forecast information """

from dataclasses import dataclass
from os import path
from os import makedirs, path
from typing import NamedTuple

from PIL import Image, ImageDraw, ImageFont
Expand Down Expand Up @@ -30,6 +30,10 @@ class WeatherForecastImage:
_FONT: str = path.join(BASE_DIR, 'assets/font/Rubik-Bold.ttf')
_IMAGES_DIR: str = path.join(BASE_DIR, 'temp')

def __init__(self):
if not path.exists(self._IMAGES_DIR):
makedirs(self._IMAGES_DIR)

@staticmethod
def _get_temperature_color(temperature: str) -> str:
"""
Expand Down

0 comments on commit 836f895

Please sign in to comment.