/usr/lib/python3/dist-packages/rasterio/rio/env.py is in python3-rasterio 0.36.0-2build5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | """Fetch and edit raster dataset metadata from the command line."""
import logging
import click
import rasterio
@click.command(short_help="Print information about the rio environment.")
@click.option('--formats', 'key', flag_value='formats', default=True,
help="Enumerate the available formats.")
@click.pass_context
def env(ctx, key):
"""Print information about the Rasterio environment: available
formats, etc.
"""
verbosity = (ctx.obj and ctx.obj.get('verbosity')) or 1
stdout = click.get_text_stream('stdout')
with rasterio.Env(CPL_DEBUG=(verbosity > 2)) as env:
if key == 'formats':
for k, v in sorted(env.drivers().items()):
stdout.write("%s: %s\n" % (k, v))
stdout.write('\n')
|