Skip to content

Commit

Permalink
Using TAB escape sequence instead of pure spaces (#1353)
Browse files Browse the repository at this point in the history
* using \t instead if raw spaces

* isort observed

* black observed
  • Loading branch information
lnxpy authored Apr 12, 2022
1 parent b306183 commit edc2f1c
Show file tree
Hide file tree
Showing 48 changed files with 134 additions and 147 deletions.
3 changes: 1 addition & 2 deletions Autocoders/Python/bin/codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
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

Expand All @@ -36,6 +34,7 @@
)
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
3 changes: 1 addition & 2 deletions Autocoders/Python/bin/gds_dictgen.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import sys
from optparse import OptionParser

from lxml import etree

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

Expand All @@ -27,6 +25,7 @@
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
21 changes: 11 additions & 10 deletions Autocoders/Python/bin/tlm_packet_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,29 @@
# 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 lxml import etree
from Cheetah.Template import Template
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,
get_nearest_build_root,
)
from lxml import etree

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
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
# 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 @@ -37,8 +37,7 @@
# 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 @@ -36,8 +36,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 @@ -35,8 +35,7 @@
# 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 @@ -37,8 +37,7 @@
# 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 @@ -36,8 +36,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 @@ -36,9 +36,11 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.serialize import SerialHeader
from fprime_ac.generators.templates.serialize import SerialImport
from fprime_ac.generators.templates.serialize import SerialBody
from fprime_ac.generators.templates.serialize import (
SerialBody,
SerialHeader,
SerialImport,
)
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 @@ -34,8 +34,10 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.topology import includes1TopologyCpp
from fprime_ac.generators.templates.topology import publicInstanceTopologyCpp
from fprime_ac.generators.templates.topology import (
includes1TopologyCpp,
publicInstanceTopologyCpp,
)
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 @@ -34,8 +34,10 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.topology import includes1TopologyH
from fprime_ac.generators.templates.topology import publicInstanceTopologyH
from fprime_ac.generators.templates.topology import (
includes1TopologyH,
publicInstanceTopologyH,
)
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 @@ -27,18 +27,19 @@
#
# from Cheetah import Template
# from fprime_ac.utils import version
from fprime_ac.utils import ConfigManager
from fprime_ac.utils import TypesList
from fprime_ac.utils import ConfigManager, TypesList

#
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.port import includes1PortCpp
from fprime_ac.generators.templates.port import namespacePortCpp
from fprime_ac.generators.templates.port import publicPortCpp
from fprime_ac.generators.templates.port import privatePortCpp
from fprime_ac.generators.templates.port import finishPortCpp
from fprime_ac.generators.templates.port import (
finishPortCpp,
includes1PortCpp,
namespacePortCpp,
privatePortCpp,
publicPortCpp,
)
except ImportError:
print("ERROR: must generate python templates first.")
sys.exit(-1)
Expand Down
21 changes: 11 additions & 10 deletions Autocoders/Python/src/fprime_ac/generators/visitors/PortHVisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,22 @@
#
# from Cheetah import Template
# from fprime_ac.utils import version
from fprime_ac.utils import ConfigManager
from fprime_ac.utils import TypesList
from fprime_ac.utils import ConfigManager, TypesList

#
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.port import startPortH
from fprime_ac.generators.templates.port import includes1PortH
from fprime_ac.generators.templates.port import includes2PortH
from fprime_ac.generators.templates.port import namespacePortH
from fprime_ac.generators.templates.port import publicPortH
from fprime_ac.generators.templates.port import protectedPortH
from fprime_ac.generators.templates.port import privatePortH
from fprime_ac.generators.templates.port import finishPortH
from fprime_ac.generators.templates.port import (
finishPortH,
includes1PortH,
includes2PortH,
namespacePortH,
privatePortH,
protectedPortH,
publicPortH,
startPortH,
)
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 @@ -33,12 +33,13 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.serialize import includes1SerialCpp
from fprime_ac.generators.templates.serialize import namespaceSerialCpp
from fprime_ac.generators.templates.serialize import publicSerialCpp

# from fprime_ac.generators.templates import privateSerialCpp
from fprime_ac.generators.templates.serialize import finishSerialCpp
from fprime_ac.generators.templates.serialize import (
finishSerialCpp,
includes1SerialCpp,
namespaceSerialCpp,
publicSerialCpp,
)
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 @@ -35,14 +35,16 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.serialize import startSerialH
from fprime_ac.generators.templates.serialize import includes1SerialH
from fprime_ac.generators.templates.serialize import includes2SerialH
from fprime_ac.generators.templates.serialize import namespaceSerialH
from fprime_ac.generators.templates.serialize import publicSerialH
from fprime_ac.generators.templates.serialize import protectedSerialH
from fprime_ac.generators.templates.serialize import privateSerialH
from fprime_ac.generators.templates.serialize import finishSerialH
from fprime_ac.generators.templates.serialize import (
finishSerialH,
includes1SerialH,
includes2SerialH,
namespaceSerialH,
privateSerialH,
protectedSerialH,
publicSerialH,
startSerialH,
)
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 @@ -36,9 +36,11 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.serialize import SerialHeader
from fprime_ac.generators.templates.serialize import SerialImport
from fprime_ac.generators.templates.serialize import SerialBody
from fprime_ac.generators.templates.serialize import (
SerialBody,
SerialHeader,
SerialImport,
)
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 @@ -34,8 +34,10 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.topology import includes1TopologyCpp
from fprime_ac.generators.templates.topology import publicTopologyCpp
from fprime_ac.generators.templates.topology import (
includes1TopologyCpp,
publicTopologyCpp,
)
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 @@ -34,8 +34,10 @@
# Import precompiled templates here
#
try:
from fprime_ac.generators.templates.topology import includes1TopologyH
from fprime_ac.generators.templates.topology import publicTopologyH
from fprime_ac.generators.templates.topology import (
includes1TopologyH,
publicTopologyH,
)
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 @@ -35,8 +35,7 @@
# 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 @@ -37,8 +37,7 @@
# 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 @@ -36,8 +36,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
10 changes: 5 additions & 5 deletions Autocoders/Python/src/fprime_ac/parsers/XmlArrayParser.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@
#
# Python standard modules
#
import hashlib
import logging
import os
import sys
import hashlib
from fprime_ac.utils import ConfigManager
from lxml import etree
from lxml import isoschematron

from fprime_ac.parsers import XmlParser
from fprime_ac.utils import ConfigManager
from fprime_ac.utils.exceptions import (
FprimeXmlException,
FprimeRngXmlValidationException,
FprimeXmlException,
)
from lxml import etree, isoschematron

#
# Python extension modules and custom interfaces
Expand Down
Loading

0 comments on commit edc2f1c

Please sign in to comment.