Changeset - f9988201a3c4
[Not reviewed]
default
0 6 0
Mads Kiilerich - 6 years ago 2019-12-21 15:14:08
mads@kiilerich.com
Grafted from: ffca1325171a
py3: some not-entirely-trivial removing of "unicode"
6 files changed with 10 insertions and 12 deletions:
0 comments (0 inline, 0 general)
kallithea/controllers/admin/admin.py
Show inline comments
 
@@ -60,7 +60,7 @@ def _journal_filter(user_log, search_ter
 
    if search_term:
 
        qp = QueryParser('repository', schema=JOURNAL_SCHEMA)
 
        qp.add_plugin(DateParserPlugin())
 
        qry = qp.parse(unicode(search_term))
 
        qry = qp.parse(search_term)
 
        log.debug('Filtering using parsed query %r', qry)
 

	
 
    def wildcard_handler(col, wc_term):
kallithea/controllers/search.py
Show inline comments
 
@@ -96,7 +96,7 @@ class SearchController(BaseRepoControlle
 
                    # for case-sensitive matching
 
                    cur_query = u'repository_rawname:%s %s' % (c.repo_name, cur_query)
 
                try:
 
                    query = qp.parse(unicode(cur_query))
 
                    query = qp.parse(cur_query)
 
                    # extract words for highlight
 
                    if isinstance(query, Phrase):
 
                        highlight_items.update(query.words)
kallithea/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -274,7 +274,7 @@ class GitRepository(BaseRepository):
 
                msg = "Revision %r does not exist for %s" % (revision, self.name)
 
                raise ChangesetDoesNotExistError(msg)
 

	
 
        if isinstance(revision, (str, unicode)):
 
        if isinstance(revision, str):
 
            if revision.isdigit() and (len(revision) < 12 or len(revision) == revision.count('0')):
 
                try:
 
                    return self.revisions[int(revision)]
kallithea/lib/vcs/backends/hg/inmemory.py
Show inline comments
 
@@ -30,12 +30,12 @@ class MercurialInMemoryChangeset(BaseInM
 
        """
 
        self.check_integrity(parents)
 

	
 
        if not isinstance(message, str):
 
            raise RepositoryError('message must be a str - got %r' % type(message))
 
        if not isinstance(author, str):
 
            raise RepositoryError('author must be a str - got %r' % type(author))
 

	
 
        from .repository import MercurialRepository
 
        if not isinstance(message, unicode) or not isinstance(author, unicode):
 
            raise RepositoryError('Given message and author needs to be '
 
                                  'an <unicode> instance got %r & %r instead'
 
                                  % (type(message), type(author)))
 

	
 
        if branch is None:
 
            branch = MercurialRepository.DEFAULT_BRANCH_NAME
 
        kwargs[b'branch'] = safe_bytes(branch)
kallithea/model/db.py
Show inline comments
 
@@ -218,9 +218,7 @@ class Setting(Base, BaseDbModel):
 
    @app_settings_value.setter
 
    def app_settings_value(self, val):
 
        """
 
        Setter that will always make sure we use unicode in app_settings_value
 

	
 
        :param val:
 
        Setter that will always make sure we use str in app_settings_value
 
        """
 
        self._app_settings_value = safe_str(val)
 

	
scripts/update-copyrights.py
Show inline comments
 
@@ -51,7 +51,7 @@ def sortkey(x):
 
    * first contribution
 
    * number of contribution years
 
    * name (with some unicode normalization)
 
    The entries must be 2-tuples of a list of string years and the unicode name"""
 
    The entries must be 2-tuples of a list of string years and the name"""
 
    return (x[0] and -int(x[0][-1]),
 
            x[0] and int(x[0][0]),
 
            -len(x[0]),
0 comments (0 inline, 0 general)