Partially restore __pkginfo__ module (closes #295480)

Pylint before 1.4.4 reads our version from there, let's not break it.

authorJulien Cristau <julien.cristau@logilab.fr>
changeset062c6adec0f1
branchdefault
phasepublic
hiddenno
parent revision#65e7c6fca229 Added tag 1.0.0, debian/1.0.0-1, centos/1.0.0-1 for changeset 08da823fb5a5
child revision#6c00e5b9e5d4 [pkg] prepare 1.0.1, #16c0d9f2d526 [pkg] prepare 1.0.1
files modified by this revision
logilab/common/__init__.py
# HG changeset patch
# User Julien Cristau <julien.cristau@logilab.fr>
# Date 1435684553 -7200
# Tue Jun 30 19:15:53 2015 +0200
# Node ID 062c6adec0f1d8de668b83f6178daa2360e2e9bf
# Parent 65e7c6fca229d6f0f99b0eae03d4ec7c4ddfb658
Partially restore __pkginfo__ module (closes #295480)

Pylint before 1.4.4 reads our version from there, let's not break it.

diff --git a/logilab/common/__init__.py b/logilab/common/__init__.py
@@ -24,14 +24,22 @@
1  :type IGNORED_EXTENSIONS: tuple
2  :var IGNORED_EXTENSIONS: file extensions that may usually be ignored
3  """
4  __docformat__ = "restructuredtext en"
5 
6 +import sys
7 +import types
8  import pkg_resources
9 
10  __version__ = pkg_resources.get_distribution('logilab-common').version
11 
12 +# deprecated, but keep compatibility with pylint < 1.4.4
13 +__pkginfo__ = types.ModuleType('__pkginfo__')
14 +__pkginfo__.__package__ = __name__
15 +__pkginfo__.version = __version__
16 +sys.modules['logilab.common.__pkginfo__'] = __pkginfo__
17 +
18  STD_BLACKLIST = ('CVS', '.svn', '.hg', 'debian', 'dist', 'build')
19 
20  IGNORED_EXTENSIONS = ('.pyc', '.pyo', '.elc', '~', '.swp', '.orig')
21 
22  # set this to False if you've mx DateTime installed but you don't want your db