Skip to content

Commit

Permalink
today()
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Jul 21, 2024
1 parent 1ade193 commit fd5a4e3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions pya2l/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,24 +143,24 @@ def import_a2l(
self.db, listener_result = a2l_parser.parse(filename=filenames.a2l, dbname=str(self._dbfn), encoding=encoding)
self.session = self.db.session

# self.logger.info("Parsing AML section ...")
self.logger.info("Parsing AML section ...")
# aml_parser = parsers.aml(prepro_result=prepro_result)

def parse_aml(file_name: str) -> str:
def parse_aml(file_name: str) -> bytes:
from pya2l import amlparser_ext

text = open(file_name).read()
# print(text)
result = amlparser_ext.parse(text)
# print(result)
return result
text: bytes = open(file_name, "rb").read()
result: bytes = amlparser_ext.parse_aml(text)
return text, result

# from pya2l import amlparser_ext
parse_aml(filenames.aml)
aml_text, aml_parsed = parse_aml(filenames.aml)
self.session.add(model.AMLSection(text=aml_text, parsed=aml_parsed))
# aml_result = aml_parser.parseFromFile(filename=filenames.aml, dbname=str(self._dbfn), encoding=encoding).listener_result
# aml_parsed = pickle.dumps(aml_result)
# aml_text = open(filenames.aml).read()
"""
self.session.add(model.AMLSection(text=aml_text, parsed=aml_parsed))
self.logger.info("Parsing IF_DATA sections ...")
Expand Down
2 changes: 1 addition & 1 deletion pya2l/aml/marshal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void dumps(std::stringstream& ss, const Member& mem) {
const auto& arr_spec = mem.get_array_spec();
const std::size_t array_size = std::size(arr_spec);
ss << to_binary(array_size);
for (const auto arr : arr_spec) {
for (std::uint32_t arr : arr_spec) {
ss << to_binary<std::uint32_t>(arr);
}
const auto& tp = mem.get_type();
Expand Down

0 comments on commit fd5a4e3

Please sign in to comment.