source: tagsplugin/tags/0.7/tractags/compat.py

Last change on this file was 13428, checked in by Steffen Hoffmann, 10 years ago

TagsPlugin: Introduce tag version recording, requires db upgrade, refs #2429.

This will especially help recovering tags after SPAM tagging, refs #11205.
Therefore configurable behavior enables tracking of wiki page tag changes, but
excludes ticket keywords changes by default.

File size: 741 bytes
Line 
1# -*- coding: utf-8 -*-
2#
3# Copyright (c) 2013, Steffen Hoffmann
4#
5# This software is licensed as described in the file COPYING, which
6# you should have received as part of this distribution.
7#
8
9"""Various classes and functions to provide backwards-compatibility with
10previous versions of Python from 2.4 and Trac from 0.11 onwards.
11"""
12
13try:
14    from trac.util.datefmt import to_utimestamp
15    from trac.util.datefmt import to_datetime
16except ImportError:
17    # Cheap fallback for Trac 0.11 compatibility.
18    from trac.util.datefmt  import to_timestamp
19    def to_utimestamp(dt):
20        return to_timestamp(dt) * 1000000L
21
22    from trac.util.datefmt import to_datetime as to_dt
23    def to_datetime(ts):
24        return to_dt(ts / 1000000)
Note: See TracBrowser for help on using the repository browser.