having moved to 4.0.0/python3.7 last night i see a couple of anomalies i did not notice in testing.
the following one is mainly cosmetic but i think i have a fix for it
uptime_os (in the “About Station” part of Season skin) presently reports obviously incorrect value:
Server uptime | 18393 days, 0 hours, 10 minutes |
WeeWX uptime | 0 days, 8 hours, 35 minutes |
WeeWX version | 4.0.0 |
looking in weewx/station.py:
from Quartz.QuartzCore import CACurrentMediaTime
os_uptime_secs = CACurrentMediaTime()
except ImportError:
a simple test shows the ImportError option is being exercised:
from Quartz.QuartzCore import CACurrentMediaTime
os_uptime_secs = CACurrentMediaTime()
print(os_uptime_secs/float(3600))
and python3.7 (from macports) gives
Traceback (most recent call last):
File "/Users/graham/a.py", line 1, in <module>
from Quartz.QuartzCore import CACurrentMediaTime
ModuleNotFoundError: No module named 'Quartz'
but python2.7 (from macos platform), where 3.9.1 worked fine, gives
reading weewx/station.py, the consequence of following the Import exception is that os_uptime_secs remains unset i.e. a garbage value
unfortunately i can’t install the missing module Quartz under python3.7:
sudo python3.7 -m pip install Quartz
Downloading quartz-0.0.1.dev0.tar.gz (217 kB)
|████████████████████████████████| 217 kB 694 kB/s
ERROR: Command errored out with exit status 1:
File "/private/tmp/pip-install-36vqysll/Quartz/setup.py", line 7, in read_dependencies
with open(req_file) as req:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
consulting doctor google, i came across module uptime, which i installed using python3.7 -m pip.
purportedly it is cross-platform including linux and linux-like. it seems to give the correct result for macos and, if it really is cross-platform, could simplify weewx/station.py by avoiding testing for each platform itself