# HG changeset patch # User Mads Kiilerich # Date 1437748660 -7200 # Node ID 72e0fe2e3278ca20749157c6c0d0e10c1fefd2ab # Parent 975f5769be08f4908fd32b81f8be7d4639e4e5d6 cleanup: remove unnecessary '%s'%s formatting diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/__init__.py --- a/kallithea/__init__.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/__init__.py Fri Jul 24 16:37:40 2015 +0200 @@ -71,7 +71,7 @@ from kallithea.lib import get_current_revision _rev = get_current_revision(quiet=True) if _rev and len(VERSION) > 3: - VERSION += ('%s' % _rev[0],) + VERSION += (_rev[0],) except ImportError: pass diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/controllers/feed.py --- a/kallithea/controllers/feed.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/controllers/feed.py Fri Jul 24 16:37:40 2015 +0200 @@ -65,9 +65,7 @@ self.feed_diff_limit = safe_int(CONF.get('rss_cut_off_limit', 32 * 1024)) def _get_title(self, cs): - return "%s" % ( - h.shorter(cs.message, 160) - ) + return h.shorter(cs.message, 160) def __changes(self, cs): changes = [] diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/lib/diffs.py --- a/kallithea/lib/diffs.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/lib/diffs.py Fri Jul 24 16:37:40 2015 +0200 @@ -618,7 +618,7 @@ """ # Transform all whitespace to underscore - idstring = re.sub(r'\s', "_", '%s' % idstring) + idstring = re.sub(r'\s', "_", idstring) # Remove everything that is not a hyphen or a member of \w idstring = re.sub(r'(?!-)\W', "", idstring).lower() return idstring diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/lib/helpers.py Fri Jul 24 16:37:40 2015 +0200 @@ -446,7 +446,7 @@ if show_rev: return 'r%s:%s' % (cs.revision, raw_id) else: - return '%s' % (raw_id) + return raw_id def fmt_date(date): @@ -606,9 +606,9 @@ if isinstance(rev, BaseChangeset) or isinstance(rev, AttributeDict): if rev.op and rev.ref_name: if rev.op == 'delete_branch': - lbl = '%s' % _('Deleted branch: %s') % rev.ref_name + lbl = _('Deleted branch: %s') % rev.ref_name elif rev.op == 'tag': - lbl = '%s' % _('Created tag: %s') % rev.ref_name + lbl = _('Created tag: %s') % rev.ref_name else: lbl = 'Unknown operation %s' % rev.op else: @@ -618,7 +618,7 @@ revision=rev.raw_id) else: # changeset cannot be found - it might have been stripped or removed - lbl = ('%s' % rev)[:12] + lbl = rev[:12] title = _('Changeset not found') if parse_cs: return link_to(lbl, _url, title=title, class_='tooltip') @@ -945,15 +945,14 @@ for thispage in xrange(leftmost_page, rightmost_page + 1): # Highlight the current page number and do not use a link + text = str(thispage) if thispage == self.page: - text = '%s' % (thispage,) # Wrap in a SPAN tag if nolink_attr is set if self.curpage_attr: text = HTML.span(c=text, **self.curpage_attr) nav_items.append(text) # Otherwise create just a link to that page else: - text = '%s' % (thispage,) nav_items.append(self._pagerlink(thispage, text)) # Insert dots if there are pages between the displayed @@ -1337,7 +1336,7 @@ % (pattern_index, ISSUE_PATTERN, ISSUE_SERVER_LNK, ISSUE_PREFIX)) - URL_PAT = re.compile(r'%s' % ISSUE_PATTERN) + URL_PAT = re.compile(ISSUE_PATTERN) def url_func(match_obj): pref = '' diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/lib/ipaddr.py --- a/kallithea/lib/ipaddr.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/lib/ipaddr.py Fri Jul 24 16:37:40 2015 +0200 @@ -514,7 +514,7 @@ return '%s(%r)' % (self.__class__.__name__, str(self)) def __str__(self): - return '%s' % self._string_from_ip_int(self._ip) + return self._string_from_ip_int(self._ip) def __hash__(self): return hash(hex(long(self._ip))) diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/lib/pidlock.py --- a/kallithea/lib/pidlock.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/lib/pidlock.py Fri Jul 24 16:37:40 2015 +0200 @@ -62,7 +62,7 @@ locking function, if lock is present it will raise LockHeld exception """ - lockname = '%s' % (os.getpid()) + lockname = str(os.getpid()) if self.debug: print 'running lock' self.trylock() diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/lib/vcs/subprocessio.py --- a/kallithea/lib/vcs/subprocessio.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/lib/vcs/subprocessio.py Fri Jul 24 16:37:40 2015 +0200 @@ -395,7 +395,7 @@ def next(self): if self.process and self.process.poll(): - err = '%s' % ''.join(self.error) + err = ''.join(self.error) raise EnvironmentError("Subprocess exited due to an error:\n" + err) return self.output.next() diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/lib/vcs/utils/diffs.py --- a/kallithea/lib/vcs/utils/diffs.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/lib/vcs/utils/diffs.py Fri Jul 24 16:37:40 2015 +0200 @@ -356,7 +356,7 @@ """ # Transform all whitespace to underscore - idstring = re.sub(r'\s', "_", '%s' % idstring) + idstring = re.sub(r'\s', "_", idstring) # Remove everything that is not a hyphen or a member of \w idstring = re.sub(r'(?!-)\W', "", idstring).lower() return idstring diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/model/comment.py --- a/kallithea/model/comment.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/model/comment.py Fri Jul 24 16:37:40 2015 +0200 @@ -75,7 +75,7 @@ if revision: notification_type = Notification.TYPE_CHANGESET_COMMENT cs = repo.scm_instance.get_changeset(revision) - desc = "%s" % (cs.short_id) + desc = cs.short_id threading = ['%s-rev-%s@%s' % (repo.repo_name, revision, h.canonical_hostname())] if line_no: # TODO: url to file _and_ line number diff -r 975f5769be08 -r 72e0fe2e3278 kallithea/tests/functional/test_my_account.py --- a/kallithea/tests/functional/test_my_account.py Fri Jul 24 16:37:40 2015 +0200 +++ b/kallithea/tests/functional/test_my_account.py Fri Jul 24 16:37:40 2015 +0200 @@ -182,7 +182,7 @@ msg = validators.ValidUsername(edit=False, old_data={})\ ._messages['username_exists'] msg = h.html_escape(msg % {'username': TEST_USER_ADMIN_LOGIN}) - response.mustcontain(u"%s" % msg) + response.mustcontain(msg) def test_my_account_api_keys(self): usr = self.log_user(TEST_USER_REGULAR2_LOGIN, TEST_USER_REGULAR2_PASS)