1
# Copyright 2008-2015 Canonical
2
# Copyright 2015 Chicharreros (https://launchpad.net/~chicharreros)
4
# This program is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU Affero General Public License as
6
# published by the Free Software Foundation, either version 3 of the
7
# License, or (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU Affero General Public License for more details.
14
# You should have received a copy of the GNU Affero General Public License
15
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17
# For further info, check http://launchpad.net/magicicada-server
19
"""Support for Database Schemas"""
24
from functools import wraps
27
def print_elapsed_time(f):
28
"""Decorator to print elapsed time.
30
To format the output nicely, do a:
31
sys.stderr.write("This is what I am doing... ")
33
Note the missing newline at the end.
36
def wrapper(*args, **kwargs):
39
r = f(*args, **kwargs)
41
sys.stderr.write(" %0.3f ms\n" % ((end - start) * 1000.0))
45
from backends.db.tools.schema.patch import ( # NOQA
46
PatchApplier, UnknownPatchError, BadPatchError)
47
from backends.db.tools.schema.schema import Schema # NOQA