summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0082.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-06-19 01:29:48 -0700
committerLance Stout <lancestout@gmail.com>2012-06-19 01:29:48 -0700
commitd92aa05b5c18806ab5addc947eeedaaf4d51500e (patch)
treebdb64fa72894b6689b38fa6e96a29e15548422fd /sleekxmpp/plugins/xep_0082.py
parentf7a74d960edb3ced00423c081ec74e9e91f3aea2 (diff)
downloadslixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.tar.gz
slixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.tar.bz2
slixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.tar.xz
slixmpp-d92aa05b5c18806ab5addc947eeedaaf4d51500e.zip
PEP8 formatting updates.
Diffstat (limited to 'sleekxmpp/plugins/xep_0082.py')
-rw-r--r--sleekxmpp/plugins/xep_0082.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0082.py b/sleekxmpp/plugins/xep_0082.py
index 96eb331a..02571fa7 100644
--- a/sleekxmpp/plugins/xep_0082.py
+++ b/sleekxmpp/plugins/xep_0082.py
@@ -42,6 +42,7 @@ def format_date(time_obj):
time_obj = time_obj.date()
return time_obj.isoformat()
+
def format_time(time_obj):
"""
Return a formatted string version of a time object.
@@ -60,6 +61,7 @@ def format_time(time_obj):
return '%sZ' % timestamp
return timestamp
+
def format_datetime(time_obj):
"""
Return a formatted string version of a datetime object.
@@ -76,6 +78,7 @@ def format_datetime(time_obj):
return '%sZ' % timestamp
return timestamp
+
def date(year=None, month=None, day=None, obj=False):
"""
Create a date only timestamp for the given instant.
@@ -98,9 +101,10 @@ def date(year=None, month=None, day=None, obj=False):
day = today.day
value = dt.date(year, month, day)
if obj:
- return value
+ return value
return format_date(value)
+
def time(hour=None, min=None, sec=None, micro=None, offset=None, obj=False):
"""
Create a time only timestamp for the given instant.
@@ -136,6 +140,7 @@ def time(hour=None, min=None, sec=None, micro=None, offset=None, obj=False):
return value
return format_time(value)
+
def datetime(year=None, month=None, day=None, hour=None,
min=None, sec=None, micro=None, offset=None,
separators=True, obj=False):
@@ -181,7 +186,7 @@ def datetime(year=None, month=None, day=None, hour=None,
value = dt.datetime(year, month, day, hour,
min, sec, micro, offset)
if obj:
- return value
+ return value
return format_datetime(value)