numerous.cli.utils module#

class numerous.cli.utils.GzippedTarball(source, paths)#

Bases: object

exception numerous.cli.utils.NumerousCommandLineError#

Bases: Exception

class numerous.cli.utils.OrganizationInterceptor(organization_slug)#

Bases: ClientInterceptor

intercept(method, request_or_iterator, call_details)#

Override this method to implement a custom interceptor.

This method is called for all unary and streaming RPCs. The interceptor implementation should call method using a grpc.ClientCallDetails and the request_or_iterator object as parameters. The request_or_iterator parameter may be type checked to determine if this is a singluar request for unary RPCs or an iterator for client-streaming or client-server streaming RPCs.

Args:
method: A function that proceeds with the invocation by executing the next

interceptor in the chain or invoking the actual RPC on the underlying channel.

request_or_iterator: RPC request message or iterator of request messages

for streaming requests.

call_details: Describes an RPC to be invoked.

Returns:

The type of the return should match the type of the return value received by calling method. This is an object that is both a Call for the RPC and a Future.

The actual result from the RPC can be got by calling .result() on the value returned from method.

class numerous.cli.utils.RepositoryConfigLoadWarning(value)#

Bases: Enum

An enumeration.

COMMIT_MISSING = 3#
PROJECT_SCENARIO_INVALID = 1#
PROJECT_SCENARIO_MISSING = 2#
REMOTE_INVALID = 0#
SNAPSHOT_MISSING = 4#
class numerous.cli.utils.StubClient(api_url, stub, plugin=None, extra_interceptors=None)#

Bases: object

numerous.cli.utils.bold(msg)#
Return type:

str

numerous.cli.utils.cyan(msg)#
Return type:

str

numerous.cli.utils.display_error_and_exit(error_header, help_lines, exit_code=1)#
numerous.cli.utils.exclude_paths(root, paths, exclude_patterns)#
Return type:

Generator[Path, None, None]

numerous.cli.utils.extract_gzipped_tarball(file, path)#
Return type:

None

numerous.cli.utils.get_grpc_channel(url, auth_plugin, extra_interceptors)#
Return type:

Channel

numerous.cli.utils.get_token_manager(api_url, organization_slug)#
Return type:

ContextManager[TokenManagerStub]

numerous.cli.utils.green(msg)#
Return type:

str

numerous.cli.utils.hash_directory(directory)#
Return type:

str

numerous.cli.utils.print_error_and_exit(msg, exit_code=1)#
numerous.cli.utils.print_load_warnings(warnings)#
Return type:

None

numerous.cli.utils.print_repository_help_message(path)#
numerous.cli.utils.red(msg)#
Return type:

str

numerous.cli.utils.walk(directory, include_pattern=None)#
numerous.cli.utils.yellow(*msg, sep=' ')#
Return type:

str