From 6c587676b00c236c79baedd78695b8b66d0b5ea8 Mon Sep 17 00:00:00 2001 From: "Dustin J. Mitchell" Date: Sat, 4 Jun 2016 19:20:07 +0000 Subject: [PATCH] Bug 1275409: move taskcluster_graph.from_now to taskgraph.util.time; r=wcosta MozReview-Commit-ID: 3GFO4f34dg8 --HG-- rename : testing/taskcluster/tests/test_from_now.py => taskcluster/taskgraph/test/test_util_time.py rename : testing/taskcluster/taskcluster_graph/from_now.py => taskcluster/taskgraph/util/time.py extra : rebase_source : 5dfe5c92fa42c2837381232d3f1b343e93f6422e --- taskcluster/taskgraph/kind/docker_image.py | 2 +- taskcluster/taskgraph/kind/legacy.py | 2 +- .../taskgraph/test/test_util_time.py | 8 +++++++- .../from_now.py => taskcluster/taskgraph/util/time.py | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) rename testing/taskcluster/tests/test_from_now.py => taskcluster/taskgraph/test/test_util_time.py (86%) rename testing/taskcluster/taskcluster_graph/from_now.py => taskcluster/taskgraph/util/time.py (92%) diff --git a/taskcluster/taskgraph/kind/docker_image.py b/taskcluster/taskgraph/kind/docker_image.py index f4c0dd00b0b2..c3bf455c674a 100644 --- a/taskcluster/taskgraph/kind/docker_image.py +++ b/taskcluster/taskgraph/kind/docker_image.py @@ -18,7 +18,7 @@ from taskgraph.util.docker import docker_image import taskcluster_graph.transform.routes as routes_transform import taskcluster_graph.transform.treeherder as treeherder_transform from taskgraph.util.templates import Templates -from taskcluster_graph.from_now import ( +from taskgraph.util.time import ( json_time_from_now, current_json_time, ) diff --git a/taskcluster/taskgraph/kind/legacy.py b/taskcluster/taskgraph/kind/legacy.py index 0ca686c55609..532908dc5095 100644 --- a/taskcluster/taskgraph/kind/legacy.py +++ b/taskcluster/taskgraph/kind/legacy.py @@ -28,7 +28,7 @@ from taskcluster_graph.mach_util import ( import taskcluster_graph.transform.routes as routes_transform import taskcluster_graph.transform.treeherder as treeherder_transform from taskcluster_graph.commit_parser import parse_commit -from taskcluster_graph.from_now import ( +from taskgraph.util.time import ( json_time_from_now, current_json_time, ) diff --git a/testing/taskcluster/tests/test_from_now.py b/taskcluster/taskgraph/test/test_util_time.py similarity index 86% rename from testing/taskcluster/tests/test_from_now.py rename to taskcluster/taskgraph/test/test_util_time.py index bc0f47b192a8..c85ddd34b485 100755 --- a/testing/taskcluster/tests/test_from_now.py +++ b/taskcluster/taskgraph/test/test_util_time.py @@ -1,7 +1,13 @@ +# -*- coding: utf-8 -*- + +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + import unittest import mozunit from datetime import datetime -from taskcluster_graph.from_now import ( +from taskgraph.util.time import ( InvalidString, UnknownTimeMeasurement, value_of, diff --git a/testing/taskcluster/taskcluster_graph/from_now.py b/taskcluster/taskgraph/util/time.py similarity index 92% rename from testing/taskcluster/taskcluster_graph/from_now.py rename to taskcluster/taskgraph/util/time.py index 7dd7d3761b0b..26de5c432058 100644 --- a/testing/taskcluster/taskcluster_graph/from_now.py +++ b/taskcluster/taskgraph/util/time.py @@ -1,3 +1,7 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + # Python port of the ms.js node module this is not a direct port some things are # more complicated or less precise and we lean on time delta here. @@ -88,3 +92,4 @@ def current_json_time(): ''' return datetime.datetime.utcnow().isoformat() + 'Z' +