Pasting the script in to the embedded python box of a Schedule window, clicking 'run', just gives an error:
- Code: Select all
Dec 10, 2019 at 9:34:45 AM
Script Error embedded script: No module named tzlocal
Script Error Exception Traceback (most recent call shown last):
embedded script, line 2, at top level
ImportError: No module named tzlocal
That initial portion of the script works fine throuhg the terminal though:
- Code: Select all
Python 2.7.16 (default, Oct 16 2019, 00:35:27)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]
Connected to Indigo Server v7.3.1, api v2.1 (localhost:1176)
>>> from datetime import datetime
>>> import tzlocal
>>> from tzlocal import get_localzone
>>> local_tz = tzlocal.get_localzone()
>>> import pytz
>>>
>>> print local_tz
America/Los_Angeles
>>>
The datetime and pytz parts work, it just chokes on the tzlocal import, which I need because some plugins' "lastupdated" times are just written in local time with no indicator, so I need to be able to apply a timezone and then convert them to UTC for other purposes.