weectl report build 16

81 views
Skip to first unread message

Steeple Ian

unread,
Nov 28, 2023, 12:26:22 PM11/28/23
to weewx-development
I do not know if this a known issue: -

Running weectl report from within a virtual environment only brings up the weectl help text: -

(weewx-venv) XXX@bookworm:~$ weectl report
usage: weectl -v|--version
       weectl -h|--help
       weectl database --help
       weectl debug --help
       weectl device --help
       weectl extension --help
       weectl import --help
       weectl report --help
       weectl station --help

weectl is the master utility used by WeeWX. It can invoke several different
subcommands, listed below. You can explore their utility by using the --help
option. For example, to find out what the 'database' subcommand can do, use
'weectl database --help'.

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit

Available subcommands:
  {database,debug,device,extension,import,report,station}
    database            Manage WeeWX databases.
    debug               Generate debug info.
    device              Manage your hardware.
    extension           List, install, or uninstall extensions.
    import              Import observation data.
    report              List and run WeeWX reports.
    station             Create, modify, or upgrade a station data area.
(weewx-venv) XXX@bookworm:~$

Vince Skahan

unread,
Nov 28, 2023, 1:58:26 PM11/28/23
to weewx-development
try 'weectl report --help' for the new expanded incantation(s)

For me, 'list' no longer works.  It throws an error.
But 'run' works.

This is a simulator with one added skin.
My vantage site with many added skins and extensions fails similarly.

(b16)

(weewx-venv) pi@pi5:~ $ weectl report run
Generating as of last timestamp in the database.
The configuration file /home/pi/weewx-data/weewx.conf will be used.

(weewx-venv) pi@pi5:~ $ ls -al /var/www/html/weewx/index.html
-rw-r--r-- 1 pi pi 32027 Nov 28 10:56 /var/www/html/weewx/index.html

(weewx-venv) pi@pi5:~ $ weectl report list
Using configuration file /home/pi/weewx-data/weewx.conf

              Report  Skin         Enabled   Units   Language
Traceback (most recent call last):
  File "/home/pi/weewx-venv/bin/weectl", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/pi/weewx-venv/lib/python3.11/site-packages/weectl.py", line 69, in main
    namespace.func(namespace)
  File "/home/pi/weewx-venv/lib/python3.11/site-packages/weectllib/report_cmd.py", line 70, in list_reports
    weectllib.report_actions.list_reports(namespace.config)
  File "/home/pi/weewx-venv/lib/python3.11/site-packages/weectllib/report_actions.py", line 47, in list_reports
    unit_system = skin_dict["unit_system"].upper()
                  ~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/pi/weewx-venv/lib/python3.11/site-packages/configobj/__init__.py", line 554, in __getitem__
    val = dict.__getitem__(self, key)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'unit_system'

Tom Keffer

unread,
Nov 28, 2023, 4:38:42 PM11/28/23
to Vince Skahan, weewx-development
The code (wrongly) assumed that a unit system would be declared. Fixed in commit 17b956c.


--
You received this message because you are subscribed to the Google Groups "weewx-development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/5370cd3a-cd2e-474b-a48c-c7affdd13fa4n%40googlegroups.com.

Steeple Ian

unread,
Nov 28, 2023, 6:04:58 PM11/28/23
to weewx-development
Tom,
The commit does not seem to have resolved the issue. I am still getting the help page when I run weectl report from within the virtual environment: -

(weewx-venv) xxx@bookworm:~$ sudo systemctl restart weewx
(weewx-venv) xxx@bookworm:~$ weectl report
(weewx-venv) xxx@bookworm:~$

Tom Keffer

unread,
Nov 28, 2023, 6:17:24 PM11/28/23
to Steeple Ian, weewx-development
The commit was not intended to do that. As Vince said, the help page is accessed using "weectl report --help"

Steeple Ian

unread,
Nov 28, 2023, 6:25:50 PM11/28/23
to weewx-development
Ok Tom, sorry I misunderstood. So my issue is that running weectl report invokes the weectl help page.

Tom Keffer

unread,
Nov 28, 2023, 6:34:59 PM11/28/23
to Steeple Ian, weewx-development
Yes, which shows that you need to do "weectl report -h".

I don't believe there's a way to get "weectl report" alone to show the help page. At least, I haven't found it!

Steeple Ian

unread,
Nov 28, 2023, 6:42:51 PM11/28/23
to weewx-development
OK I am with it now, I had missed the point that you need to use weectl report run. All good now.
Reply all
Reply to author
Forward
0 new messages