Add function for getting a string of today's date in %Y-%m-%d format.
parent
8c6821ea0e
commit
c96aed31ed
7
gnupg.py
7
gnupg.py
|
@ -70,6 +70,8 @@ try:
|
|||
except ImportError:
|
||||
from cStringIO import StringIO
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import codecs
|
||||
import locale
|
||||
import logging
|
||||
|
@ -484,6 +486,11 @@ def _make_binary_stream(s, encoding):
|
|||
rv = StringIO(s)
|
||||
return rv
|
||||
|
||||
def _today():
|
||||
"""Get the current date as a string in the form %Y-%m-%d."""
|
||||
now_string = datetime.now().__str__()
|
||||
return now_string.split(' ', 1)[0]
|
||||
|
||||
def _sanitise(*args):
|
||||
"""
|
||||
Take an arg or the key portion of a kwarg and check that it is in the set
|
||||
|
|
Loading…
Reference in New Issue