From 8701d404ec4a3d6f4b046e3312268db1e91ab0b1 Mon Sep 17 00:00:00 2001 From: RingOV Date: Wed, 29 May 2019 11:30:49 +0300 Subject: [PATCH] fix --- gis-weather.py | 10 ++++++++-- services/gismeteo.py | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gis-weather.py b/gis-weather.py index 207ae7a..f002bd2 100644 --- a/gis-weather.py +++ b/gis-weather.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 # # gis_weather.py -v = '0.8.2.84' +v = '0.8.2.85' # Copyright (C) 2013-2018 Alexander Koltsov # # This program is free software: you can redistribute it and/or modify @@ -1505,7 +1505,13 @@ def draw_scaled_image_svg(self, cr, x, y, pix, w, h, ang = 0): cr.translate(-w//2, -h//2) else: cr.translate(x, y) - cr.scale(w/svg.props.width, h/svg.props.height) + k=1 + if svg.props.width>svg.props.height: + k=svg.props.width/svg.props.height + if k==1: + cr.scale(w/svg.props.width, h/svg.props.height) + else: + cr.scale(w/svg.props.width, h/svg.props.height/k) svg.render_cairo(cr) cr.restore() diff --git a/services/gismeteo.py b/services/gismeteo.py index b36b970..8f3c71d 100644 --- a/services/gismeteo.py +++ b/services/gismeteo.py @@ -278,7 +278,6 @@ def get_weather(): sunrise = dt1.strftime('%H:%M') sunset = dt2.strftime('%H:%M') sun_duration = ':'.join(str(dt3).split(':')[:2]) - print(sunrise, sunset, sun_duration) # temperature t_now = re.findall('