mirror of
https://github.com/YunoHost/moulinette.git
synced 2024-09-03 20:06:31 +02:00
Wat da fuke pytz
This commit is contained in:
parent
1dfc4ecfa3
commit
8c7b6c0e5f
2 changed files with 5 additions and 2 deletions
|
@ -7,7 +7,6 @@ import locale
|
||||||
import logging
|
import logging
|
||||||
from argparse import SUPPRESS
|
from argparse import SUPPRESS
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
import pytz
|
|
||||||
from datetime import date, datetime
|
from datetime import date, datetime
|
||||||
|
|
||||||
import argcomplete
|
import argcomplete
|
||||||
|
@ -101,6 +100,8 @@ def pretty_date(_date):
|
||||||
Argument:
|
Argument:
|
||||||
- date -- The date or datetime to display
|
- date -- The date or datetime to display
|
||||||
"""
|
"""
|
||||||
|
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
|
||||||
|
|
||||||
# Deduce system timezone
|
# Deduce system timezone
|
||||||
nowutc = datetime.now(tz=pytz.utc)
|
nowutc = datetime.now(tz=pytz.utc)
|
||||||
nowtz = datetime.now()
|
nowtz = datetime.now()
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
from json.encoder import JSONEncoder
|
from json.encoder import JSONEncoder
|
||||||
import datetime
|
import datetime
|
||||||
import pytz
|
|
||||||
|
|
||||||
logger = logging.getLogger('moulinette.utils.serialize')
|
logger = logging.getLogger('moulinette.utils.serialize')
|
||||||
|
|
||||||
|
@ -22,6 +21,9 @@ class JSONExtendedEncoder(JSONEncoder):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def default(self, o):
|
def default(self, o):
|
||||||
|
|
||||||
|
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
|
||||||
|
|
||||||
"""Return a serializable object"""
|
"""Return a serializable object"""
|
||||||
# Convert compatible containers into list
|
# Convert compatible containers into list
|
||||||
if isinstance(o, set) or (
|
if isinstance(o, set) or (
|
||||||
|
|
Loading…
Add table
Reference in a new issue