Giter Club home page Giter Club logo

a2l2xdf's People

Contributors

aarons3 avatar amiriello avatar bri3d avatar connorhowell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

a2l2xdf's Issues

ImportError: cannot import name 'DB' from 'pya2l'

Traceback (most recent call last):
File "d:\Data\a2l2xdf-master\a2l2xdf.py", line 6, in
from pya2l import DB, model
ImportError: cannot import name 'DB' from 'pya2l' (C:\Users\An\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\pya2l_init_.py)

UnicodeDecodeError

I get a similar error message with all a2l files I have tested. What am I doing wrong?

$ python3 a2l2xdf.py sa.a2l a2l2xdf.csv
Traceback (most recent call last):
  File "a2l2xdf.py", line 15, in <module>
    db.open_existing(argv[1]) if path.exists(f"{argv[1]}db") else db.import_a2l(argv[1])
  File "/home/chris/.local/lib/python3.7/site-packages/pya2l/__init__.py", line 115, in import_a2l
    prepro_result = prepro.process(self._a2lfn, encoding = detect_encoding(self._a2lfn))
  File "/home/chris/.local/lib/python3.7/site-packages/pya2l/preprocessor.py", line 160, in process
    data = self._process_file(file_name, join_lines = True, encoding = encoding)
  File "/home/chris/.local/lib/python3.7/site-packages/pya2l/preprocessor.py", line 173, in _process_file
    for num, line in enumerate(f_obj, 1):
  File "/usr/lib/python3.7/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe4 in position 7497: ordinal not in range(128)

[ERROR (pya2l.pya2l.a2l_listener)]: ASAP2 Version '1.4' may not parsed correctly.

Traceback (most recent call last):
File "C:\Users\John\Downloads\a2l2xdf-master\a2l2xdf.py", line 15, in
db.open_existing(argv[1]) if path.exists(f"{argv[1]}db") else db.import_a2l(argv[1])
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\pya2l_init_.py", line 126, in import_a2l
self.db = a2l_parser.parseFromString(prepro_result.a2l_data, dbname = str(self._dbfn), encoding = encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\pya2l\parserlib.py", line 116, in parseFromString
return self.parse(antlr4.InputStream(buf), trace)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\pya2l\parserlib.py", line 99, in parse
result = walker.walk(listener, tree)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\antlr4\tree\Tree.py", line 160, in walk
self.walk(listener, child)
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\antlr4\tree\Tree.py", line 160, in walk
self.walk(listener, child)
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\antlr4\tree\Tree.py", line 160, in walk
self.walk(listener, child)
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\antlr4\tree\Tree.py", line 161, in walk
self.exitRule(listener, t)
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\antlr4\tree\Tree.py", line 188, in exitRule
ctx.exitRule(listener)
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\pya2l\a2lParser.py", line 4990, in exitRule
listener.exitCharacteristic(self)
File "C:\Users\John\AppData\Local\Programs\Python\Python312\Lib\site-packages\pya2l\a2l_listener.py", line 487, in exitCharacteristic
address = ctx.address.value
^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'value'

Usage Example

Hey there,

Great work here, I'm not the best with python, so it was unclear to me how to use this correctly.

A quick look at the code makes me assume I call the a2l2xdf.py like so in terminal or cmd

python3 a2l2xdf.py mya2lfile.a2l thecsvfile.csv

which will then output the mya2lfile.xdf

I was unsure how I use the csv file correctly?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.