Ah, didn't notice you were on 4.5.1. There was a change to units.py under 
4.6.x that forced a change in weeimport.py, consequently the weeimport.py 
version I provided does not get on with WeeWX 4.5.x. Let me get you a 4.5.x 
compatible version.

Gary

On Friday, 4 March 2022 at 13:16:57 UTC+10 Glenn McKechnie wrote:

> On 04/03/2022, gjr80 <[email protected]> wrote:
> > Glenn,
> >
> > Have you had a chance to try the revised wee_import? I am working on a
> > number of other changes to the same piece of wee_import code and I would
> > prefer to do them all at once if possible.
>
> Whoops. Sorry about that. It slid down the Todo list a little too
> far. ie;- I got somewhat sidetracked.
>
> Re-visiting this and I find I've either forgotten something critical,
> or it just plain doesn't work...
>
> I'm stll using the weewx.451 installation where I was developing this.
> I've fetched and replaced weeimport/weeimport.py as per your instructions.
>
> sudo bin/wee_import --import-config=/home/weewx/csv.conf
> --config=/home/weewx/weewx.conf --verbose --dry-run
>
> and I get the following error (with dry-run and without) ...
>
> Using WeeWX configuration file /home/weewx/weewx.conf
> Starting wee_import...
> A CSV import from source file '/var/tmp/weewxaddnotes.csv' has been 
> requested.
> The following options will be used:
> config=/home/weewx/weewx.conf, import-config=/home/weewx/csv.conf
> source=/var/tmp/weewxaddnotes.csv, from=None, to=None
> dry-run=True, calc_missing=True, ignore_invalid_data=True
> tranche=250, interval=conf, date/time_string_format=%Y-%m-%d %H:%M:%S
> delimiter=',', rain=cumulative, wind_direction=[-360.0, 360.0]
> UV=False, radiation=False
> Using database binding 'wx_binding', which is bound to database 'weewx.sdb'
> Destination table 'archive' unit system is '0x10' (METRIC).
> Missing derived observations will be calculated.
> All WeeWX UV fields will be set to None.
> All WeeWX radiation fields will be set to None.
> This is a dry run, imported data will not be saved to archive.
> Starting dry run import ...
> Obtaining raw import data for period 1 ...
> Traceback (most recent call last):
> File "bin/wee_import", line 899, in <module>
> main()
> File "bin/wee_import", line 829, in main
> source_obj.run()
> File "/home/weewx451/bin/weeimport/weeimport.py", line 372, in run
> _raw_data = self.getRawData(period)
> File "/home/weewx451/bin/weeimport/csvimport.py", line 246, in getRawData
> self.map = self.parseMap('CSV', _csv_reader, self.csv_config_dict)
> File "/home/weewx451/bin/weeimport/weeimport.py", line 635, in parseMap
> and _val['units'] not in weewx.units.USUnits.values() \
> AttributeError: 'ListOfDicts' object has no attribute 'values'
>
>
> The database field is named ANComment, the field I'm importing is
> named ANComment
>
> The attached files will show the full details. weewx.conf is unedited,
> it's a throw away installation.
>
> And, I've just cloned the wee_import_text branch - gives the same error.
>
> -- 
>
>
> Cheers
> Glenn
>
> rorpi - read only raspberry pi & various weewx addons
> https://github.com/glennmckechnie
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/6c3c0002-d12c-449c-afdf-080f7c5ead10n%40googlegroups.com.

Reply via email to