Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Date option throws an error #7

Closed
peternijssen opened this issue Nov 27, 2018 · 3 comments
Closed

Date option throws an error #7

peternijssen opened this issue Nov 27, 2018 · 3 comments

Comments

@peternijssen
Copy link

peternijssen commented Nov 27, 2018

Hi Mark,

2 things;
Small typo in your README file. In the last example it says "data" rather than "date".

Secondly, when I run the command, with "2018-11-22" I get the following error;

Traceback (most recent call last):
  File "/usr/local/bin/gw2pvo", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.5/dist-packages/gw2pvo/__main__.py", line 116, in run
    copy(args)
  File "/usr/local/lib/python3.5/dist-packages/gw2pvo/__main__.py", line 78, in copy
    temperatures = ds.get_temperature_for_day(data['latitude'], data['longitude'], date)
  File "/usr/local/lib/python3.5/dist-packages/gw2pvo/ds_api.py", line 48, in get_temperature_for_day
    'date' : date.astimezone(datetime.now().tzinfo).isoformat()
ValueError: astimezone() cannot be applied to a naive datetime

Command I issued;

/usr/local/bin/gw2pvo --gw-station-id "<<XXX>>" --gw-account "<<XXX>>" --gw-password "<<XXX>>" --pvo-system-id "<<XXX>>" --pvo-api-key "<<XXX>>" --darksky-api-key "<<XXX>>" --date "2018-11-22"

When I leave out the darksky API, I get the following error;

Traceback (most recent call last):
  File "/usr/local/bin/gw2pvo", line 11, in <module>
    sys.exit(run())
  File "/usr/local/lib/python3.5/dist-packages/gw2pvo/__main__.py", line 116, in run
    copy(args)
  File "/usr/local/lib/python3.5/dist-packages/gw2pvo/__main__.py", line 82, in copy
    pvo.add_day(data['entries'], temperatures)
UnboundLocalError: local variable 'temperatures' referenced before assignment
@markruys
Copy link
Owner

markruys commented Dec 2, 2018

Okay, I've fixed the issues you mentioned. Could you please give it a try?

@peternijssen
Copy link
Author

Works perfect. Thanks!

@markruys
Copy link
Owner

markruys commented Dec 2, 2018

Great, I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants