##// END OF EJS Templates
lint: more autofixes
super-admin -
r1153:bc27ecc0 default
parent child Browse files
Show More
@@ -130,7 +130,7 b' class LFSOidStore:'
130 130 f.write('...')
131 131 """
132 132
133 class StoreEngine(object):
133 class StoreEngine:
134 134 def __init__(self, mode, store_path, oid_path, tmp_oid_path):
135 135 self.mode = mode
136 136 self.store_path = store_path
@@ -71,7 +71,7 b' class StatsClientBase:'
71 71
72 72 def incr(self, stat, count=1, rate=1, tags=None):
73 73 """Increment a stat by `count`."""
74 self._send_stat(stat, '%s|c' % count, rate, tags)
74 self._send_stat(stat, f'{count}|c', rate, tags)
75 75
76 76 def decr(self, stat, count=1, rate=1, tags=None):
77 77 """Decrement a stat by `count`."""
@@ -85,18 +85,18 b' class StatsClientBase:'
85 85 return
86 86 with self.pipeline() as pipe:
87 87 pipe._send_stat(stat, '0|g', 1)
88 pipe._send_stat(stat, '%s|g' % value, 1)
88 pipe._send_stat(stat, f'{value}|g', 1)
89 89 else:
90 90 prefix = '+' if delta and value >= 0 else ''
91 self._send_stat(stat, '%s%s|g' % (prefix, value), rate, tags)
91 self._send_stat(stat, f'{prefix}{value}|g', rate, tags)
92 92
93 93 def set(self, stat, value, rate=1):
94 94 """Set a set value."""
95 self._send_stat(stat, '%s|s' % value, rate)
95 self._send_stat(stat, f'{value}|s', rate)
96 96
97 97 def histogram(self, stat, value, rate=1, tags=None):
98 98 """Set a histogram"""
99 self._send_stat(stat, '%s|h' % value, rate, tags)
99 self._send_stat(stat, f'{value}|h', rate, tags)
100 100
101 101 def _send_stat(self, stat, value, rate, tags=None):
102 102 self._after(self._prepare(stat, value, rate, tags))
@@ -108,10 +108,10 b' class StatsClientBase:'
108 108 if rate < 1:
109 109 if random.random() > rate:
110 110 return
111 value = '%s|@%s' % (value, rate)
111 value = f'{value}|@{rate}'
112 112
113 113 if self._prefix:
114 stat = '%s.%s' % (self._prefix, stat)
114 stat = f'{self._prefix}.{stat}'
115 115
116 116 res = '%s:%s%s' % (
117 117 stat,
@@ -123,7 +123,7 b' class GitRepository:'
123 123 # blows up if you sprinkle "flush" (0000) as "0001\n".
124 124 # It reads binary, per number of bytes specified.
125 125 # if you do add '\n' as part of data, count it.
126 server_advert = '# service=%s\n' % git_command
126 server_advert = f'# service={git_command}\n'
127 127 packet_len = hex(len(server_advert) + 4)[2:].rjust(4, '0').lower()
128 128 try:
129 129 gitenv = dict(os.environ)
@@ -59,7 +59,7 b' class BaseInstallHooks:'
59 59 HOOK_FILES = ()
60 60
61 61 def _check_hook_file_mode(self, file_path):
62 assert os.path.exists(file_path), 'path %s missing' % file_path
62 assert os.path.exists(file_path), f'path {file_path} missing'
63 63 stat_info = os.stat(file_path)
64 64
65 65 file_mode = stat.S_IMODE(stat_info.st_mode)
General Comments 0
You need to be logged in to leave comments. Login now