Add function for getting a string of today's date in %Y-%m-%d format.

feature/documentation-builds-html
Isis Lovecruft 2013-04-10 19:14:48 +00:00
parent 8c6821ea0e
commit c96aed31ed
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 7 additions and 0 deletions

View File

@ -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