Skip to content

Commit

Permalink
Update badges/reactions.py to count reactions (#555)
Browse files Browse the repository at this point in the history
  • Loading branch information
skearnes authored Feb 12, 2021
1 parent 831b047 commit 2448b79
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions badges/reactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from absl import flags
from absl import logging

from ord_schema import message_helpers
from ord_schema.proto import dataset_pb2

FLAGS = flags.FLAGS
Expand All @@ -31,9 +32,8 @@
def main(argv):
del argv # Only used by app.run().
num_reactions = 0
for filename in glob.glob(os.path.join(FLAGS.root, '*', '*.pb')):
with open(filename, 'rb') as f:
dataset = dataset_pb2.Dataset.FromString(f.read())
for filename in glob.glob(os.path.join(FLAGS.root, '*', '*.pb*')):
dataset = message_helpers.load_message(filename, dataset_pb2.Dataset)
logging.info('%s:\t%d', filename, len(dataset.reactions))
num_reactions += len(dataset.reactions)
args = {
Expand Down

0 comments on commit 2448b79

Please sign in to comment.