This commit is contained in:
Waylon Walker 2022-03-31 20:20:07 -05:00
commit 38355d2442
No known key found for this signature in database
GPG key ID: 66E2BF2B4190EFE4
9083 changed files with 1225834 additions and 0 deletions

40
.venv/bin/find-import Executable file
View file

@ -0,0 +1,40 @@
#!/home/walkers/git/creeper-adventure/.venv/bin/python3
"""
Usage: find-import names...
Prints how to import given name(s).
"""
# pyflyby/find-import
# Copyright (C) 2011, 2014 Karl Chen.
# License: MIT http://opensource.org/licenses/MIT
from __future__ import absolute_import, division, with_statement
from __future__ import print_function
from pyflyby._cmdline import parse_args, syntax
from pyflyby._importdb import ImportDB
from pyflyby._log import logger
def main():
options, args = parse_args(import_format_params=True)
if not args:
syntax()
db = ImportDB.get_default(".")
known = db.known_imports.by_import_as
errors = 0
for arg in args:
try:
imports = known[arg]
except KeyError:
errors += 1
logger.error("Can't find import for %r", arg)
else:
for imp in imports:
print(imp.pretty_print(params=options.params), end=' ')
if errors:
raise SystemExit(1)
if __name__ == '__main__':
main()