mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-12-22 13:42:14 +01:00
Made some changes to ensure compatibility in Python 2 with gettext.
The gettext.install() functions supplies a way to force it to return unicode which helps with compatibility between Python 2 & 3. To make it work properly when merging those returned string with strings in the different modules of gitinspector we also had to do some changes to make sure all string literals are in unicode.
This commit is contained in:
parent
9c0633f8ad
commit
f20c3c1895
13 changed files with 20 additions and 5 deletions
|
@ -17,6 +17,8 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
__comment_begining__ = {"java": "/*", "c": "/*", "cpp": "/*", "h": "/*", "hpp": "/*", "html": "<!--", "php": "/*",
|
||||
"py": "\"\"\"", "glsl": "/*", "rb": "=begin", "js": "/*", "sql": "/*", "xml": "<!--"}
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from outputable import Outputable
|
||||
import terminal
|
||||
import textwrap
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from outputable import Outputable
|
||||
import terminal
|
||||
import textwrap
|
||||
|
@ -44,7 +45,7 @@ def set_filtered(file_name):
|
|||
return True
|
||||
return False
|
||||
|
||||
__filtering_info_text__ = _("The following files were excluded from the statistics due to the"
|
||||
__filtering_info_text__ = _("The following files were excluded from the statistics due to the "
|
||||
"specified exclusion patterns")
|
||||
|
||||
class Filtering(Outputable):
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
import version
|
||||
import base64
|
||||
import basedir
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import localization
|
||||
localization.init()
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from extensions import __default_extensions__
|
||||
from format import __available_formats__
|
||||
import sys
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
__since__ = ""
|
||||
|
||||
__until__ = ""
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# You should have received a copy of the GNU General Public License
|
||||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import gettext
|
||||
import locale
|
||||
import os
|
||||
|
@ -38,4 +39,4 @@ def init():
|
|||
except IOError:
|
||||
translation = gettext.NullTranslations()
|
||||
|
||||
translation.install()
|
||||
translation.install(True)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from outputable import Outputable
|
||||
import interval
|
||||
import os
|
||||
|
|
|
@ -18,17 +18,18 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
import format
|
||||
|
||||
class Outputable(object):
|
||||
def output_html(self):
|
||||
print(_("HTML output not yet supported in \"") + self.__class__.__name__ + "\".")
|
||||
print(_("HTML output not yet supported in") + " \"" + self.__class__.__name__ + "\".")
|
||||
|
||||
def output_text(self):
|
||||
print(_("Text output not yet supported in \"") + self.__class__.__name__ + "\".")
|
||||
print(_("Text output not yet supported in") + " \"" + self.__class__.__name__ + "\".")
|
||||
|
||||
def output_xml(self):
|
||||
print(_("XML output not yet supported in \"") + self.__class__.__name__ + "\".")
|
||||
print(_("XML output not yet supported in") + " \"" + self.__class__.__name__ + "\".")
|
||||
|
||||
def output(outputable):
|
||||
if format.get_selected() == "html":
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from outputable import Outputable
|
||||
import blame
|
||||
import terminal
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
from outputable import Outputable
|
||||
import datetime
|
||||
import terminal
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
# along with gitinspector. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import localization
|
||||
localization.init()
|
||||
|
|
Loading…
Reference in a new issue