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
|
||||
from argparse import SUPPRESS
|
||||
from collections import OrderedDict
|
||||
import pytz
|
||||
from datetime import date, datetime
|
||||
|
||||
import argcomplete
|
||||
|
@ -101,6 +100,8 @@ def pretty_date(_date):
|
|||
Argument:
|
||||
- date -- The date or datetime to display
|
||||
"""
|
||||
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
|
||||
|
||||
# Deduce system timezone
|
||||
nowutc = datetime.now(tz=pytz.utc)
|
||||
nowtz = datetime.now()
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import logging
|
||||
from json.encoder import JSONEncoder
|
||||
import datetime
|
||||
import pytz
|
||||
|
||||
logger = logging.getLogger('moulinette.utils.serialize')
|
||||
|
||||
|
@ -22,6 +21,9 @@ class JSONExtendedEncoder(JSONEncoder):
|
|||
"""
|
||||
|
||||
def default(self, o):
|
||||
|
||||
import pytz # Lazy loading, this takes like 3+ sec on a RPi2 ?!
|
||||
|
||||
"""Return a serializable object"""
|
||||
# Convert compatible containers into list
|
||||
if isinstance(o, set) or (
|
||||
|
|
Loading…
Add table
Reference in a new issue