Moved unicode function declaration to a compatibility module.

This is used (as the name suggests) for compatibility between Python 2 and
Python 3.
This commit is contained in:
Adam Waldenberg 2013-07-12 03:33:13 +02:00
parent 8edd72a609
commit f4b10ce15f
2 changed files with 32 additions and 7 deletions

View File

@ -0,0 +1,27 @@
#!/usr/bin/python
# coding: utf-8
#
# Copyright © 2013 Ejwa Software. All rights reserved.
#
# This file is part of gitinspector.
#
# gitinspector is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# gitinspector is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
import sys
try:
unicode
except NameError:
def unicode(string):
return str(string)

View File

@ -21,16 +21,14 @@
from __future__ import print_function
from __future__ import unicode_literals
#Small fix for Python 3
try:
unicode
except NameError:
def unicode(string):
return str(string)
import localization
localization.init()
try:
from compatibility import unicode
except:
pass
import blame
import changes
import config