mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
python: Convert more percent formatting to Python 3.6 f-strings.
Generated by pyupgrade --py36-plus. Now including %d, %i, %u, and multi-line strings. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
1ed2d9b4a0
commit
74c17bf94a
@@ -36,8 +36,8 @@ class Command(BaseCommand):
|
||||
public_count += 1
|
||||
print("------------")
|
||||
print(realm.string_id, end=' ')
|
||||
print("%10s %d public streams and" % ("(", public_count), end=' ')
|
||||
print("%d private streams )" % (private_count,))
|
||||
print("{:>10} {} public streams and".format("(", public_count), end=' ')
|
||||
print(f"{private_count} private streams )")
|
||||
print("------------")
|
||||
print("{:>25} {:>15} {:>10} {:>12}".format("stream", "subscribers", "messages", "type"))
|
||||
|
||||
@@ -48,9 +48,9 @@ class Command(BaseCommand):
|
||||
stream_type = 'public'
|
||||
print(f"{stream.name:>25}", end=' ')
|
||||
recipient = Recipient.objects.filter(type=Recipient.STREAM, type_id=stream.id)
|
||||
print("%10d" % (len(Subscription.objects.filter(recipient=recipient,
|
||||
active=True)),), end=' ')
|
||||
print("{:10}".format(len(Subscription.objects.filter(recipient=recipient,
|
||||
active=True))), end=' ')
|
||||
num_messages = len(Message.objects.filter(recipient=recipient))
|
||||
print("%12d" % (num_messages,), end=' ')
|
||||
print(f"{num_messages:12}", end=' ')
|
||||
print(f"{stream_type:>15}")
|
||||
print("")
|
||||
|
||||
Reference in New Issue
Block a user