Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using TAB escape sequence instead of pure spaces #1353

Merged
merged 3 commits into from
Apr 12, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 7 additions & 18 deletions Autocoders/Python/bin/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,28 +14,17 @@
import traceback
from optparse import OptionParser

from lxml import etree

# Meta-model for Component only generation
from fprime_ac.models import CompFactory, PortFactory, Serialize, TopoFactory

# Parsers to read the XML
from fprime_ac.parsers import (
XmlComponentParser,
XmlParser,
XmlPortsParser,
XmlSerializeParser,
XmlTopologyParser,
)
from fprime_ac.utils import (
ArrayGenerator,
ConfigManager,
EnumGenerator,
Logger,
TopDictGenerator,
)
from fprime_ac.utils.buildroot import get_build_roots, search_for_file, set_build_roots
from fprime_ac.parsers import (XmlComponentParser, XmlParser, XmlPortsParser,
XmlSerializeParser, XmlTopologyParser)
from fprime_ac.utils import (ArrayGenerator, ConfigManager, EnumGenerator,
Logger, TopDictGenerator)
from fprime_ac.utils.buildroot import (get_build_roots, search_for_file,
set_build_roots)
from fprime_ac.utils.version import get_fprime_version, get_project_version
from lxml import etree

# Generators to produce the code
try:
Expand Down
4 changes: 1 addition & 3 deletions Autocoders/Python/bin/gds_dictgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,14 @@
import sys
from optparse import OptionParser

from lxml import etree

# Meta-model for Component only generation
from fprime_ac.models import TopoFactory

# Parsers to read the XML
from fprime_ac.parsers import XmlParser, XmlTopologyParser
from fprime_ac.utils import ConfigManager, TopDictGenerator
from fprime_ac.utils.buildroot import get_build_roots, set_build_roots
from fprime_ac.utils.version import get_fprime_version, get_project_version
from lxml import etree

# Generators to produce the code
try:
Expand Down
13 changes: 4 additions & 9 deletions Autocoders/Python/bin/implgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,14 @@
from optparse import OptionParser

from fprime_ac.generators.writers import ImplCppWriter, ImplHWriter

# Meta-model for Component only generation
from fprime_ac.models import CompFactory

# Parsers to read the XML
from fprime_ac.parsers import (
XmlComponentParser,
XmlParser,
XmlPortsParser,
XmlSerializeParser,
)
from fprime_ac.parsers import (XmlComponentParser, XmlParser, XmlPortsParser,
XmlSerializeParser)
from fprime_ac.utils import ConfigManager, Logger
from fprime_ac.utils.buildroot import get_build_roots, search_for_file, set_build_roots
from fprime_ac.utils.buildroot import (get_build_roots, search_for_file,
set_build_roots)
from utils.pathmaker import setup_fprime_autocoder_path

setup_fprime_autocoder_path()
Expand Down
20 changes: 6 additions & 14 deletions Autocoders/Python/bin/pymod_dictgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,16 @@
import sys
from optparse import OptionParser

from fprime_ac.generators.writers import (
InstChannelWriter,
InstCommandWriter,
InstEventWriter,
)

from fprime_ac.generators.writers import (InstChannelWriter, InstCommandWriter,
InstEventWriter)
# Meta-model for Component only generation
from fprime_ac.models import CompFactory, ModelParser, TopoFactory

# Parsers to read the XML
from fprime_ac.parsers import (
XmlParser,
XmlPortsParser,
XmlSerializeParser,
XmlTopologyParser,
)
from fprime_ac.parsers import (XmlParser, XmlPortsParser, XmlSerializeParser,
XmlTopologyParser)
from fprime_ac.utils import ConfigManager
from fprime_ac.utils.buildroot import get_build_roots, search_for_file, set_build_roots
from fprime_ac.utils.buildroot import (get_build_roots, search_for_file,
set_build_roots)

# Generators to produce the code
try:
Expand Down
26 changes: 8 additions & 18 deletions Autocoders/Python/bin/testgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,18 @@
import time
from optparse import OptionParser

from fprime_ac.generators.writers import (
ComponentTestCppWriter,
ComponentTestHWriter,
GTestCppWriter,
GTestHWriter,
TestImplCppWriter,
TestImplHWriter,
TestMainWriter,
)

from fprime_ac.generators.writers import (ComponentTestCppWriter,
ComponentTestHWriter, GTestCppWriter,
GTestHWriter, TestImplCppWriter,
TestImplHWriter, TestMainWriter)
# Meta-model for Component only generation
from fprime_ac.models import CompFactory

# Parsers to read the XML
from fprime_ac.parsers import (
XmlComponentParser,
XmlParser,
XmlPortsParser,
XmlSerializeParser,
)
from fprime_ac.parsers import (XmlComponentParser, XmlParser, XmlPortsParser,
XmlSerializeParser)
from fprime_ac.utils import ConfigManager
from fprime_ac.utils.buildroot import get_build_roots, search_for_file, set_build_roots
from fprime_ac.utils.buildroot import (get_build_roots, search_for_file,
set_build_roots)

# Generators to produce the code
try:
Expand Down
20 changes: 6 additions & 14 deletions Autocoders/Python/bin/tlm_packet_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,20 @@
# ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledged.
# ===============================================================================

import logging
import os
import sys
import logging

from optparse import OptionParser

from Cheetah.Template import Template
# Meta-model for Component only generation
from fprime_ac.models import TopoFactory
from fprime_ac.parsers import XmlSerializeParser
from fprime_ac.parsers import XmlEnumParser
from fprime_ac.parsers import XmlArrayParser

# Parsers to read the XML
from fprime_ac.parsers import XmlTopologyParser

from fprime_ac.parsers import (XmlArrayParser, XmlEnumParser,
XmlSerializeParser, XmlTopologyParser)
from fprime_ac.utils.buildroot import (get_nearest_build_root, search_for_file,
set_build_roots)
from lxml import etree
from Cheetah.Template import Template
from fprime_ac.utils.buildroot import (
search_for_file,
set_build_roots,
get_nearest_build_root,
)

header_file_template = """

Expand Down
1 change: 0 additions & 1 deletion Autocoders/Python/schema/testSchemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pytest
from lxml import etree


"""
To add tests, go down to the setup function.
"""
Expand Down
76 changes: 21 additions & 55 deletions Autocoders/Python/src/fprime_ac/generators/GenFactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,61 +21,27 @@

from fprime_ac.utils import Logger

from . import (
DictBody,
DictHeader,
DictStart,
FinishSource,
HtmlDocPage,
HtmlStartPage,
Includes1,
Includes2,
InitFiles,
InstanceDictBody,
InstanceDictHeader,
InstanceDictStart,
MdDocPage,
MdStartPage,
Namespace,
Private,
Protected,
Public,
StartSource,
)
from .visitors import (
ChannelVisitor,
CommandVisitor,
ComponentCppVisitor,
ComponentHVisitor,
ComponentTestCppVisitor,
ComponentTestHVisitor,
EventVisitor,
GTestCppVisitor,
GTestHVisitor,
HtmlDocVisitor,
ImplCppVisitor,
ImplHVisitor,
InstanceChannelVisitor,
InstanceCommandVisitor,
InstanceEventVisitor,
InstanceSerializableVisitor,
InstanceTopologyChannelsHTMLVisitor,
InstanceTopologyCmdHTMLVisitor,
InstanceTopologyCppVisitor,
InstanceTopologyEventsHTMLVisitor,
InstanceTopologyHVisitor,
MdDocVisitor,
PortCppVisitor,
PortHVisitor,
SerialCppVisitor,
SerialHVisitor,
SerializableVisitor,
TestImplCppVisitor,
TestImplHVisitor,
TopologyCppVisitor,
TopologyHVisitor,
TopologyIDVisitor,
)
from . import (DictBody, DictHeader, DictStart, FinishSource, HtmlDocPage,
HtmlStartPage, Includes1, Includes2, InitFiles,
InstanceDictBody, InstanceDictHeader, InstanceDictStart,
MdDocPage, MdStartPage, Namespace, Private, Protected, Public,
StartSource)
from .visitors import (ChannelVisitor, CommandVisitor, ComponentCppVisitor,
ComponentHVisitor, ComponentTestCppVisitor,
ComponentTestHVisitor, EventVisitor, GTestCppVisitor,
GTestHVisitor, HtmlDocVisitor, ImplCppVisitor,
ImplHVisitor, InstanceChannelVisitor,
InstanceCommandVisitor, InstanceEventVisitor,
InstanceSerializableVisitor,
InstanceTopologyChannelsHTMLVisitor,
InstanceTopologyCmdHTMLVisitor,
InstanceTopologyCppVisitor,
InstanceTopologyEventsHTMLVisitor,
InstanceTopologyHVisitor, MdDocVisitor, PortCppVisitor,
PortHVisitor, SerialCppVisitor, SerialHVisitor,
SerializableVisitor, TestImplCppVisitor,
TestImplHVisitor, TopologyCppVisitor, TopologyHVisitor,
TopologyIDVisitor)

# Global logger init. below.
PRINT = logging.getLogger("output")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
import os
import sys

from fprime_ac.utils.buildroot import (
BuildRootMissingException,
build_root_relative_path,
)
from fprime_ac.utils.buildroot import (BuildRootMissingException,
build_root_relative_path)

#
# Python extension modules and custom interfaces
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from fprime_ac.generators import formatters
from fprime_ac.generators.visitors import AbstractVisitor

# from fprime_ac.utils import DiffAndRename
#
# Python extension modules and custom interfaces
Expand All @@ -35,8 +34,8 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.channels import ChannelHeader
from fprime_ac.generators.templates.channels import ChannelBody
from fprime_ac.generators.templates.channels import (ChannelBody,
ChannelHeader)
except ImportError:
print("ERROR: must generate python templates first.")
sys.exit(-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
from getpass import getuser

from fprime_ac.generators import formatters

# from fprime_ac.utils import DiffAndRename
from fprime_ac.generators.visitors import AbstractVisitor
from fprime_ac.models import Command, Parameter

#
# Python extension modules and custom interfaces
#
Expand All @@ -37,8 +35,8 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.commands import CommandHeader
from fprime_ac.generators.templates.commands import CommandBody
from fprime_ac.generators.templates.commands import (CommandBody,
CommandHeader)
except ImportError:
print("ERROR: must generate python templates first.")
sys.exit(-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from fprime_ac.generators import formatters
from fprime_ac.generators.visitors import AbstractVisitor
from fprime_ac.models import ModelParser

#
# Python extension modules and custom interfaces
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,8 @@
from getpass import getuser

from fprime_ac.generators import formatters

# from fprime_ac.utils import DiffAndRename
from fprime_ac.generators.visitors import AbstractVisitor

#
# Python extension modules and custom interfaces
#
Expand All @@ -36,8 +34,7 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.events import EventHeader
from fprime_ac.generators.templates.events import EventBody
from fprime_ac.generators.templates.events import EventBody, EventHeader
except ImportError:
print("ERROR: must generate python templates first.")
sys.exit(-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from fprime_ac.generators import formatters
from fprime_ac.generators.visitors import AbstractVisitor

# from fprime_ac.utils import DiffAndRename
#
# Python extension modules and custom interfaces
Expand All @@ -35,8 +34,8 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.channels import ChannelHeader
from fprime_ac.generators.templates.channels import ChannelBody
from fprime_ac.generators.templates.channels import (ChannelBody,
ChannelHeader)
except ImportError:
print("ERROR: must generate python templates first.")
sys.exit(-1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@
from getpass import getuser

from fprime_ac.generators import formatters

# from fprime_ac.utils import DiffAndRename
from fprime_ac.generators.visitors import AbstractVisitor
from fprime_ac.models import Command, Parameter

#
# Python extension modules and custom interfaces
#
Expand All @@ -37,8 +35,8 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.commands import CommandHeader
from fprime_ac.generators.templates.commands import CommandBody
from fprime_ac.generators.templates.commands import (CommandBody,
CommandHeader)
except ImportError:
print("ERROR: must generate python templates first.")
sys.exit(-1)
Expand Down
Loading