~mpontillo/maas/discovery-js-factory

« back to all changes in this revision

Viewing changes to src/maasserver/websockets/__init__.py

  • Committer: Mike Pontillo
  • Date: 2016-09-02 20:25:22 UTC
  • Revision ID: mike.pontillo@canonical.com-20160902202522-3gid0v8jz1sn0hri
Add discovery websocket handler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2016 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
"""Utilities for the WebSocket connections."""
 
5
 
 
6
DATETIME_FORMAT = "%a, %d %b. %Y %H:%M:%S"
 
7
 
 
8
 
 
9
def dehydrate_datetime(datetime):
 
10
    """Convert the `datetime` to string with `DATETIME_FORMAT`."""
 
11
    return datetime.strftime(DATETIME_FORMAT)
 
12
 
 
13