Changeset - e2519d2e74c2
[Not reviewed]
default
0 12 0
Mads Kiilerich - 7 years ago 2018-06-09 16:30:22
mads@kiilerich.com
unicode: consistently use the preferred Python spelling 'utf-8' instead of the alias 'utf8'
12 files changed with 14 insertions and 14 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -158,7 +158,7 @@ api_access_controllers_whitelist =
 

	
 
## default encoding used to convert from and to unicode
 
## can be also a comma separated list of encoding in case of mixed encodings
 
default_encoding = utf8
 
default_encoding = utf-8
 

	
 
## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea
 
hgencoding = utf-8
kallithea/lib/helpers.py
Show inline comments
 
@@ -475,7 +475,7 @@ def show_id(cs):
 

	
 
def fmt_date(date):
 
    if date:
 
        return date.strftime("%Y-%m-%d %H:%M:%S").decode('utf8')
 
        return date.strftime("%Y-%m-%d %H:%M:%S").decode('utf-8')
 

	
 
    return ""
 

	
kallithea/lib/middleware/pygrack.py
Show inline comments
 
@@ -176,7 +176,7 @@ class GitRepository(object):
 
                update_server_info(repo._repo)
 

	
 
        resp = Response()
 
        resp.content_type = 'application/x-%s-result' % git_command.encode('utf8')
 
        resp.content_type = 'application/x-%s-result' % git_command.encode('utf-8')
 
        resp.charset = None
 
        resp.app_iter = out
 
        return resp
kallithea/lib/paster_commands/template.ini.mako
Show inline comments
 
@@ -252,7 +252,7 @@ api_access_controllers_whitelist =
 

	
 
<%text>## default encoding used to convert from and to unicode</%text>
 
<%text>## can be also a comma separated list of encoding in case of mixed encodings</%text>
 
default_encoding = utf8
 
default_encoding = utf-8
 

	
 
<%text>## Set Mercurial encoding, similar to setting HGENCODING before launching Kallithea</%text>
 
hgencoding = utf-8
kallithea/lib/utils.py
Show inline comments
 
@@ -435,7 +435,7 @@ def set_vcs_config(config):
 
    conf.settings.GIT_EXECUTABLE_PATH = config.get('git_path', 'git')
 
    conf.settings.GIT_REV_FILTER = config.get('git_rev_filter', '--all').strip()
 
    conf.settings.DEFAULT_ENCODINGS = aslist(config.get('default_encoding',
 
                                                        'utf8'), sep=',')
 
                                                        'utf-8'), sep=',')
 

	
 

	
 
def set_indexer_config(config):
kallithea/lib/utils2.py
Show inline comments
 
@@ -176,7 +176,7 @@ def safe_unicode(str_, from_encoding=Non
 
    if not from_encoding:
 
        import kallithea
 
        DEFAULT_ENCODINGS = aslist(kallithea.CONFIG.get('default_encoding',
 
                                                        'utf8'), sep=',')
 
                                                        'utf-8'), sep=',')
 
        from_encoding = DEFAULT_ENCODINGS
 

	
 
    if not isinstance(from_encoding, (list, tuple)):
 
@@ -225,7 +225,7 @@ def safe_str(unicode_, to_encoding=None)
 
    if not to_encoding:
 
        import kallithea
 
        DEFAULT_ENCODINGS = aslist(kallithea.CONFIG.get('default_encoding',
 
                                                        'utf8'), sep=',')
 
                                                        'utf-8'), sep=',')
 
        to_encoding = DEFAULT_ENCODINGS
 

	
 
    if not isinstance(to_encoding, (list, tuple)):
kallithea/lib/vcs/backends/hg/inmemory.py
Show inline comments
 
@@ -53,7 +53,7 @@ class MercurialInMemoryChangeset(BaseInM
 
            for node in self.added:
 
                if node.path == path:
 
                    return memfilectx(_repo, memctx, path=node.path,
 
                        data=(node.content.encode('utf8')
 
                        data=(node.content.encode('utf-8')
 
                              if not node.is_binary else node.content),
 
                        islink=False,
 
                        isexec=node.is_executable,
 
@@ -63,7 +63,7 @@ class MercurialInMemoryChangeset(BaseInM
 
            for node in self.changed:
 
                if node.path == path:
 
                    return memfilectx(_repo, memctx, path=node.path,
 
                        data=(node.content.encode('utf8')
 
                        data=(node.content.encode('utf-8')
 
                              if not node.is_binary else node.content),
 
                        islink=False,
 
                        isexec=node.is_executable,
kallithea/lib/vcs/conf/settings.py
Show inline comments
 
@@ -17,7 +17,7 @@ if os.path.isdir(VCSRC_PATH):
 
    VCSRC_PATH = os.path.join(VCSRC_PATH, '__init__.py')
 

	
 
# list of default encoding used in safe_unicode/safe_str methods
 
DEFAULT_ENCODINGS = aslist('utf8')
 
DEFAULT_ENCODINGS = aslist('utf-8')
 

	
 
# path to git executable run by run_git_command function
 
GIT_EXECUTABLE_PATH = 'git'
kallithea/tests/vcs/test_changesets.py
Show inline comments
 
# encoding: utf8
 
# encoding: utf-8
 

	
 
import time
 
import datetime
kallithea/tests/vcs/test_filenodes_unicode_path.py
Show inline comments
 
# encoding: utf8
 
# encoding: utf-8
 

	
 
import datetime
 

	
kallithea/tests/vcs/test_inmemchangesets.py
Show inline comments
 
# encoding: utf8
 
# encoding: utf-8
 
"""
 
Tests so called "in memory changesets" commit API of vcs.
 
"""
scripts/update-copyrights.py
Show inline comments
 
@@ -143,7 +143,7 @@ def sortkey(x):
 
    return (x[0] and -int(x[0][-1]),
 
            x[0] and int(x[0][0]),
 
            -len(x[0]),
 
            x[1].decode('utf8').lower().replace(u'\xe9', u'e').replace(u'\u0142', u'l')
 
            x[1].decode('utf-8').lower().replace(u'\xe9', u'e').replace(u'\u0142', u'l')
 
        )
 

	
 

	
0 comments (0 inline, 0 general)