Skip to content

Commit

Permalink
More reliably find local timezone
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Evans <n1be@github.com>
  • Loading branch information
Bob Evans committed Aug 14, 2016
1 parent 357841e commit 2bd487b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions himawaripy/himawaripy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from PIL import Image
from pytz import timezone
from tzlocal import get_localzone
from dateutil.tz import tzlocal

from .config import level, output_file, auto_offset, hour_offset
from .utils import set_background, get_desktop_environment
Expand All @@ -24,7 +24,7 @@

def get_time_offset(latest_date):
if auto_offset:
local_date = datetime.now(timezone(str(get_localzone())))
local_date = datetime.now(tzlocal())
himawari_date = datetime.now(timezone('Australia/Sydney'))
local_offset = local_date.strftime("%z")
himawari_offset = himawari_date.strftime("%z")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
description='Put near-realtime picture of Earth as your desktop background',
long_description='himawaripy is a Python 3 script that fetches near-realtime (10 minutes delayed) picture of Earth '
'as its taken by Himawari 8 (ひまわり8号) and sets it as your desktop background.',
install_requires=["appdirs", "pillow", "python-dateutil", "pytz", "tzlocal"],
install_requires=["appdirs", "pillow", "python-dateutil", "pytz"],
packages=find_packages(),
entry_points={'console_scripts': ['himawaripy=himawaripy.himawaripy:main']},
)

0 comments on commit 2bd487b

Please sign in to comment.