Use pkg_resources and bump 3.0.1

This commit is contained in:
Florian Mounier
2017-03-20 10:43:23 +01:00
parent 8ad12c2379
commit b9c991e3b6
2 changed files with 11 additions and 8 deletions

View File

@@ -14,15 +14,22 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = '3.0.0'
import os
import tornado.web
import tornado.options
import tornado.web
from logging import getLogger
try:
import pkg_resources
except ImportError:
__version__ = "pkg_resources not found on PYTHON_PATH"
else:
try:
__version__ = pkg_resources.require('butterfly')[0].version
except pkg_resources.DistributionNotFound:
__version__ = "butterfly is not installed"
log = getLogger('butterfly')

View File

@@ -4,13 +4,9 @@
"""
Butterfly - A sleek web based terminal emulator
"""
import os
import re
from setuptools import setup
ROOT = os.path.dirname(__file__)
with open(os.path.join(ROOT, 'butterfly', '__init__.py')) as fd:
__version__ = re.search("__version__ = '([^']+)'", fd.read()).group(1)
__version__ = '3.0.1'
options = dict(
name="butterfly",