Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env python
# http://www.chromium.org/developers/owners-files
# https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/8a57ce17e317c0213a95f7e504d13132badcdf2f/owners.py
# https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/master/owners_finder.py
# https://chromium.googlesource.com/chromium/tools/depot_tools.git/+/master/tests/owners_unittest.py
import glob
import os
import owners
import owners_finder
owners_db = owners.Database('.', fopen=file, os_path=os.path, glob=glob.glob)
files = ['gcl.bat', 'gclient_scm.py', 'tests/owners_unittest.py']
owners_f = owners_finder.OwnersFinder(files, '.', 'user@example.com', fopen=file, os_path=os.path, glob=glob.glob)
import pprint
pprint.pprint(owners_db.reviewers_for(['gcl.bat'], 'user@example.com'))
pprint.pprint(owners_db.reviewers_for(['gclient_scm.py'], 'user@example.com'))
pprint.pprint(owners_db.files_not_covered_by(['gcl.bat'], ['user@example.com']))
owners_db.load_data_needed_for(files)
pprint.pprint(owners_db.all_possible_owners(files, 'user@example.com'))
pprint.pprint(owners_f.run()) # Note: interactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment