From 809e9ed87cc36e8aba6fcdadd7f3a0e0c58be7e5 Mon Sep 17 00:00:00 2001 From: Dessa Simpson Date: Sun, 14 Jul 2024 16:31:20 -0700 Subject: [PATCH] allow adjusting moon size --- xaphoon.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/xaphoon.py b/xaphoon.py index 6fd4a81..b5fb49e 100755 --- a/xaphoon.py +++ b/xaphoon.py @@ -26,7 +26,7 @@ def to_timestr(t, date=False, local=True): return t.strftime('%Y-%m-%d %H:%M:%S') return t.strftime('%H:%M:%S') -def fmt(cols, t, az, el, phase, illum, moonrise, transit, moonset, hemi): +def fmt(cols, t, az, el, phase, illum, moonrise, transit, moonset, moonlines, hemi): """Formats data into string to print""" _date = t.utc_datetime().astimezone().strftime('%Y-%m-%d %H:%M:%S') # 18 chars _azel = f"Az:{az.degrees:.0f}° El:{el.degrees:.0f}°".ljust(16) # 16 chars @@ -34,8 +34,7 @@ def fmt(cols, t, az, el, phase, illum, moonrise, transit, moonset, hemi): _r = f"R:{to_timestr(moonrise)}" # 10 chars _t = f"T:{to_timestr(transit)}" # 10 chars _s = f"S:{to_timestr(moonset)}" # 10 chars - # TODO: 21 needs to scale - _moon = putmoon(phase.degrees/360, 21, hemi) # ! scalable width + _moon = putmoon(phase.degrees/360, moonlines, hemi) # ! scalable width # 2 groups of spacing, filling cols minus total RTS width _rts_spacing = ' '*int((cols-30)/2) @@ -108,7 +107,7 @@ def main(): #print(phase.degrees/360*100) #print(putmoon(phase.degrees/360, 21, 'north' if args.lat > 0 else 'south')) - print(fmt(args.columns, t, az, el, phase, illum, moonrise, transit, moonset, hemi)) + print(fmt(args.columns, t, az, el, phase, illum, moonrise, transit, moonset, args.lines - 4,hemi)) #print(putmoon(phase.degrees/360, 21, '@', hemi)) main()