src/p4l/__init__.py
author ymh <ymh.work@gmail.com>
Sat, 05 Oct 2013 14:46:07 +0200
changeset 138 f01b65d6c724
parent 133 554c6622898c
child 151 8d74009f8f46
permissions -rw-r--r--
Nouvelle version 0.3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
126
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     1
# -*- coding: utf-8 -*-
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     2
#
131
f1854630734f change copyright notice
ymh <ymh.work@gmail.com>
parents: 126
diff changeset
     3
# Copyright IRI (c) 2013
126
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     4
#
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     5
# contact@iri.centrepompidou.fr
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     6
#
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     7
# This software is governed by the CeCILL-B license under French law and
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     8
# abiding by the rules of distribution of free software.  You can  use, 
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
     9
# modify and/ or redistribute the software under the terms of the CeCILL-B
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    10
# license as circulated by CEA, CNRS and INRIA at the following URL
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    11
# "http://www.cecill.info". 
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    12
#
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    13
# As a counterpart to the access to the source code and  rights to copy,
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    14
# modify and redistribute granted by the license, users are provided only
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    15
# with a limited warranty  and the software's author,  the holder of the
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    16
# economic rights,  and the successive licensors  have only  limited
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    17
# liability. 
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    18
#
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    19
# In this respect, the user's attention is drawn to the risks associated
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    20
# with loading,  using,  modifying and/or developing or reproducing the
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    21
# software by the user in light of its specific status of free software,
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    22
# that may mean  that it is complicated to manipulate,  and  that  also
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    23
# therefore means  that it is reserved for developers  and  experienced
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    24
# professionals having in-depth computer knowledge. Users are therefore
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    25
# encouraged to load and test the software's suitability as regards their
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    26
# requirements in conditions enabling the security of their systems and/or 
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    27
# data to be ensured and,  more generally, to use and operate it in the 
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    28
# same conditions as regards security. 
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    29
#
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    30
# The fact that you are presently reading this means that you have had
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    31
# knowledge of the CeCILL-B license and that you accept its terms.
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    32
#
a345f1a67bf1 Python licence headers
ymh <ymh.work@gmail.com>
parents: 124
diff changeset
    33
138
f01b65d6c724 Nouvelle version 0.3
ymh <ymh.work@gmail.com>
parents: 133
diff changeset
    34
VERSION = (0, 3, 0, "final", 0)
120
6ec0300b626e - update django
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    35
6ec0300b626e - update django
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    36
124
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    37
def get_version(version=VERSION):
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    38
    "Returns a PEP 386-compliant version number from VERSION."
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    39
    assert len(version) == 5
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    40
    assert version[3] in ('alpha', 'beta', 'rc', 'final')
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    41
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    42
    # Now build the two parts of the version number:
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    43
    # main = X.Y[.Z]
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    44
    # sub = .devN - for pre-alpha releases
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    45
    #     | {a|b|c}N - for alpha, beta and rc releases
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    46
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    47
    parts = 2 if version[2] == 0 else 3
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    48
    main = '.'.join(str(x) for x in version[:parts])
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    49
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    50
    sub = ''
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    51
    if version[3] != 'final':
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    52
        mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'}
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    53
        sub = mapping[version[3]] + str(version[4])
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    54
4b4dd6817db3 slightly change version numbering
ymh <ymh.work@gmail.com>
parents: 122
diff changeset
    55
    return str(main + sub)
120
6ec0300b626e - update django
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    56
6ec0300b626e - update django
ymh <ymh.work@gmail.com>
parents: 0
diff changeset
    57
__version__ = get_version()