mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-30 08:23:37 +00:00
Change add support for freebsd /var/db/zoneinfo when getting local timezone information.
This commit is contained in:
parent
7c68ac2439
commit
cd412e22e5
4 changed files with 11 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -13,9 +13,10 @@ restore/
|
|||
|
||||
######################
|
||||
# SB Test Related #
|
||||
tests/cache/*
|
||||
tests/Logs/*
|
||||
tests/sickbeard.*
|
||||
tests/cache.db
|
||||
tests/*.db
|
||||
|
||||
######################
|
||||
# Compiled source #
|
||||
|
|
|
@ -190,6 +190,7 @@
|
|||
* Fix add custom torrent RSS
|
||||
* Remove ILT torrent provider
|
||||
* Update Tornado Web Server 4.3.dev1 (1b6157d) to 4.4.dev1 (c2b4d05)
|
||||
* Change add support for freebsd /var/db/zoneinfo when getting local timezone information
|
||||
|
||||
|
||||
### 0.11.15 (2016-09-13 19:50:00 UTC)
|
||||
|
|
|
@ -10,3 +10,4 @@ Libs with customisations...
|
|||
/lib/requests/packages/urllib3/util/ssl_.py
|
||||
/lib/tornado
|
||||
/lib/tvdb/tvdb_api.py
|
||||
/lib/tzlocal/unix.py
|
||||
|
|
|
@ -90,6 +90,13 @@ def _get_localzone(_root='/'):
|
|||
# We found a timezone
|
||||
return pytz.timezone(etctz.replace(' ', '_'))
|
||||
|
||||
# look for FreeBSD's /var/db/zoneinfo file, which contains the zone name and a newline.
|
||||
freebsd_zoneinfo = os.path.join(_root, 'var/db/zoneinfo')
|
||||
if os.path.exists(freebsd_zoneinfo):
|
||||
with open(freebsd_zoneinfo, 'rt') as tzfile:
|
||||
data = tzfile.read().strip()
|
||||
return pytz.timezone(data)
|
||||
|
||||
# systemd distributions use symlinks that include the zone name,
|
||||
# see manpage of localtime(5) and timedatectl(1)
|
||||
tzpath = os.path.join(_root, 'etc/localtime')
|
||||
|
|
Loading…
Reference in a new issue