Skip to content

Commit

Permalink
Fixed circular imports bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ShafSpecs committed Jun 19, 2024
1 parent 9086efa commit c9f795c
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 34 deletions.
2 changes: 1 addition & 1 deletion pb_plugins/protoc_gen_mavsdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
""" Autogenerator for MAVSDK """


from .autogen import AutoGen
from protoc_gen_mavsdk.autogen import AutoGen
2 changes: 1 addition & 1 deletion pb_plugins/protoc_gen_mavsdk/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import sys
from google.protobuf.compiler import plugin_pb2
from . import AutoGen
from protoc_gen_mavsdk.autogen import AutoGen


def main():
Expand Down
12 changes: 6 additions & 6 deletions pb_plugins/protoc_gen_mavsdk/autogen.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# -*- coding: utf-8 -*-
from os import environ
from google.protobuf.compiler import plugin_pb2
from .autogen_file import File
from .docs import Docs
from .enum import Enum
from .methods import Method
from .struct import Struct
from .utils import (get_template_env,
from protoc_gen_mavsdk.autogen_file import File
from protoc_gen_mavsdk.docs import Docs
from protoc_gen_mavsdk.pb_enum import Enum
from protoc_gen_mavsdk.methods import Method
from protoc_gen_mavsdk.pb_struct import Struct
from protoc_gen_mavsdk.utils import (get_template_env,
has_result,
is_server,
name_parser_factory,
Expand Down
2 changes: 1 addition & 1 deletion pb_plugins/protoc_gen_mavsdk/autogen_file.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from .utils import name_parser_factory
from protoc_gen_mavsdk.utils import name_parser_factory


class File(object):
Expand Down
2 changes: 0 additions & 2 deletions pb_plugins/protoc_gen_mavsdk/docs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# -*- coding: utf-8 -*-


class Docs:
"""
Docs
Expand Down
2 changes: 0 additions & 2 deletions pb_plugins/protoc_gen_mavsdk/mavsdk_options_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions pb_plugins/protoc_gen_mavsdk/methods.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# -*- coding: utf-8 -*-
from .utils import (filter_out_result,
is_stream,
name_parser_factory,
no_return,
Param,
remove_subscribe,
type_info_factory)
from protoc_gen_mavsdk.utils import (filter_out_result,
is_stream,
name_parser_factory,
no_return,
Param,
remove_subscribe,
type_info_factory)


class Method(object):
Expand Down
2 changes: 0 additions & 2 deletions pb_plugins/protoc_gen_mavsdk/name_parser.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import json
import re

from os import environ


class NameParserFactory:
_initialisms = []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
from .utils import name_parser_factory
from protoc_gen_mavsdk.utils import name_parser_factory


class Enum(object):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# -*- coding: utf-8 -*-


from .enum import Enum
from .utils import (is_request,
is_response,
is_struct,
name_parser_factory,
Param,
type_info_factory)
from protoc_gen_mavsdk.pb_enum import Enum
from protoc_gen_mavsdk.utils import (is_request,
is_response,
is_struct,
name_parser_factory,
Param,
type_info_factory)


class Struct(object):
Expand Down
4 changes: 2 additions & 2 deletions pb_plugins/protoc_gen_mavsdk/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from jinja2 import Environment, FileSystemLoader
from .name_parser import NameParserFactory
from .type_info import TypeInfoFactory
from protoc_gen_mavsdk.name_parser import NameParserFactory
from protoc_gen_mavsdk.type_info import TypeInfoFactory


name_parser_factory = NameParserFactory()
Expand Down

0 comments on commit c9f795c

Please sign in to comment.