# Path: artman/utils/protoc_utils.py
# class _SimpleProtoParams(object):
# class _JavaProtoParams(_SimpleProtoParams):
# class _GoProtoParams(_SimpleProtoParams):
# class _PhpProtoParams(_SimpleProtoParams):
# class _RubyProtoParams(_SimpleProtoParams):
# class _PythonProtoParams(_SimpleProtoParams):
#     def __init__(self, language):
#     def code_root(self, output_dir):
#     def proto_plugin_path(self, plugin_args=None):
#     def plugin_out_param(self, output_dir, plugin_args=None):
#     def default_lang_out_value(self, with_grpc):
#     def lang_out_param(self, output_dir, with_grpc, language_out_override):
#     def grpc_plugin_path(self, dummy_toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def proto_plugin_path(self):
#     def plugin_out_param(self, output_dir, plugin_args=None):
#     def grpc_plugin_path(self, toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def default_lang_out_value(self, with_grpc):
#     def grpc_plugin_path(self, toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def grpc_plugin_path(self, dummy_toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def lang_out_param(self, output_dir, with_grpc, language_out_override):
#     def grpc_plugin_path(self, dummy_toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
# def protoc_binary_name(language):
# def group_by_go_package(proto_files):
#     def go_pkg(file):
# def protoc_header_params(proto_path,
#                           toolkit_path):
# def protoc_desc_params(output_dir, desc_out_file):
# def protoc_proto_params(proto_params, pkg_dir, gapic_yaml, with_grpc, language_out_override):
# def protoc_grpc_params(proto_params, pkg_dir, toolkit_path):
# def protoc_plugin_params(proto_params, pkg_dir, gapic_yaml):
# def protoc_common_resources_params(root_dir, common_resources=None):
# def find_google_dir_index(src_proto_path):
# def pkg_root_dir(output_dir, api_name, api_version, organization_name,
#                  language, prefix=None):
# def prepare_proto_pkg_dir(output_dir, api_name, api_version, organization_name,
#                           language):
# def prepare_grpc_pkg_dir(output_dir, api_name, api_version, organization_name,
#                          language):
# def prepare_pkg_dir(output_dir, api_name, api_version, organization_name,
#                     language, prefix):
# def find_protos(proto_paths, excluded_proto_path):
# def list_files_recursive(path):
# def php_proto_rename(contents):
# def _is_proto_excluded(proto, excluded_proto_path):
# def _find_protobuf_path(toolkit_path):
# PROTO_PARAMS_MAP = {
#     'ruby': _RubyProtoParams(),
#     'java': _JavaProtoParams(),
#     'go': _GoProtoParams(),
#     'csharp': _SimpleProtoParams('csharp'),
#     'php': _PhpProtoParams(),
#     'python': _PythonProtoParams(),
#     'nodejs': _SimpleProtoParams('nodejs'),
# }
# 
# Path: artman/tasks/task_base.py
# class TaskBase(Task):
# class EmptyTask(TaskBase):
#     def __init__(self, *args, **kwargs):
#     def log(self, msg, logger=artman_logger, level=logging.INFO):
#     def exec_command(self, args):
#     def execute(self):
#     def validate(self):


import io
import os
import re
import tempfile
import time
from ruamel import yaml
from artman.utils import protoc_utils
from artman.tasks import task_base
                for line in src_lines:
                    import_ = self._IMPORT_REGEX.match(line)
                    if import_:
                        dest_file.write('import "{}";\n'.format(
                            self._transform(
                                import_.group('package'), '/', common_protos)))
                    else:
                        dest_file.write(line)

    def _copy_and_transform_directories(
            self, src_directories, destination_directory, common_protos,
            paths=None):
        for path in src_directories:
            protos = list(protoc_utils.find_protos([path], []))
            for proto in protos:
                src_base_dirs = self._extract_base_dirs(proto)
                sub_new_src = os.path.join(
                    destination_directory,
                    self._transform(
                        src_base_dirs, os.path.sep, common_protos))
                if paths is not None:
                    paths.add(sub_new_src)

                dest = os.path.join(sub_new_src, os.path.basename(proto))
                if not os.path.exists(dest):
                    self.exec_command(['mkdir', '-p', sub_new_src])
                self._copy_proto(
                    proto, os.path.join(sub_new_src, dest), common_protos)



# Path: artman/utils/protoc_utils.py
# class _SimpleProtoParams(object):
# class _JavaProtoParams(_SimpleProtoParams):
# class _GoProtoParams(_SimpleProtoParams):
# class _PhpProtoParams(_SimpleProtoParams):
# class _RubyProtoParams(_SimpleProtoParams):
# class _PythonProtoParams(_SimpleProtoParams):
#     def __init__(self, language):
#     def code_root(self, output_dir):
#     def proto_plugin_path(self, plugin_args=None):
#     def plugin_out_param(self, output_dir, plugin_args=None):
#     def default_lang_out_value(self, with_grpc):
#     def lang_out_param(self, output_dir, with_grpc, language_out_override):
#     def grpc_plugin_path(self, dummy_toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def proto_plugin_path(self):
#     def plugin_out_param(self, output_dir, plugin_args=None):
#     def grpc_plugin_path(self, toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def default_lang_out_value(self, with_grpc):
#     def grpc_plugin_path(self, toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def grpc_plugin_path(self, dummy_toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
#     def __init__(self):
#     def code_root(self, output_dir):
#     def lang_out_param(self, output_dir, with_grpc, language_out_override):
#     def grpc_plugin_path(self, dummy_toolkit_path):
#     def grpc_out_param(self, output_dir):
#     def proto_compiler_command(self):
# def protoc_binary_name(language):
# def group_by_go_package(proto_files):
#     def go_pkg(file):
# def protoc_header_params(proto_path,
#                           toolkit_path):
# def protoc_desc_params(output_dir, desc_out_file):
# def protoc_proto_params(proto_params, pkg_dir, gapic_yaml, with_grpc, language_out_override):
# def protoc_grpc_params(proto_params, pkg_dir, toolkit_path):
# def protoc_plugin_params(proto_params, pkg_dir, gapic_yaml):
# def protoc_common_resources_params(root_dir, common_resources=None):
# def find_google_dir_index(src_proto_path):
# def pkg_root_dir(output_dir, api_name, api_version, organization_name,
#                  language, prefix=None):
# def prepare_proto_pkg_dir(output_dir, api_name, api_version, organization_name,
#                           language):
# def prepare_grpc_pkg_dir(output_dir, api_name, api_version, organization_name,
#                          language):
# def prepare_pkg_dir(output_dir, api_name, api_version, organization_name,
#                     language, prefix):
# def find_protos(proto_paths, excluded_proto_path):
# def list_files_recursive(path):
# def php_proto_rename(contents):
# def _is_proto_excluded(proto, excluded_proto_path):
# def _find_protobuf_path(toolkit_path):
# PROTO_PARAMS_MAP = {
#     'ruby': _RubyProtoParams(),
#     'java': _JavaProtoParams(),
#     'go': _GoProtoParams(),
#     'csharp': _SimpleProtoParams('csharp'),
#     'php': _PhpProtoParams(),
#     'python': _PythonProtoParams(),
#     'nodejs': _SimpleProtoParams('nodejs'),
# }
# 
# Path: artman/tasks/task_base.py
# class TaskBase(Task):
# class EmptyTask(TaskBase):
#     def __init__(self, *args, **kwargs):
#     def log(self, msg, logger=artman_logger, level=logging.INFO):
#     def exec_command(self, args):
#     def execute(self):
#     def validate(self):


# Path: artman/tasks/python_grpc_tasks.py
import io
import os
import re
import tempfile
import time
from ruamel import yaml
from artman.utils import protoc_utils
from artman.tasks import task_base

                for line in src_lines:
                    import_ = self._IMPORT_REGEX.match(line)
                    if import_:
                        dest_file.write('import "{}";\n'.format(
                            self._transform(
                                import_.group('package'), '/', common_protos)))
                    else:
                        dest_file.write(line)

    def _copy_and_transform_directories(
            self, src_directories, destination_directory, common_protos,
            paths=None):
        for path in src_directories:
            protos = list(protoc_utils.find_protos([path], []))
            for proto in protos:
                src_base_dirs = self._extract_base_dirs(proto)
                sub_new_src = os.path.join(
                    destination_directory,
                    self._transform(
                        src_base_dirs, os.path.sep, common_protos))
                if paths is not None:
                    paths.add(sub_new_src)

                dest = os.path.join(sub_new_src, os.path.basename(proto))
                if not os.path.exists(dest):
                    self.exec_command(['mkdir', '-p', sub_new_src])
                self._copy_proto(
                    proto, os.path.join(sub_new_src, dest), common_protos)



class PythonMoveProtosTask(task_base.TaskBase):