Code Monkey home page Code Monkey logo

Comments (5)

nbedos avatar nbedos commented on May 22, 2024 1

Hi,

I've modified termtosvg so that is uses a basic configuration file instead of Xresources. This means no more dependency on Xlib and no more crash for you, hopefully!

I have not released this version to the production pypi server yet, but you can dowload it from the test server:

pip install --extra-index-url https://test.pypi.org/simple/ 'termtosvg>=0.3.0rc0'

The updated README is available here: https://github.com/nbedos/termtosvg/tree/release/0.3.0

from termtosvg.

nbedos avatar nbedos commented on May 22, 2024

Hi, thanks for reporting the issue!

Even if your OS is old, termtosvg should not crash this way. I've asked the folks over at Xlib about it (python-xlib/python-xlib#117). Could you please watch the issue and provide them with more info about your setup if needed?

In the meantime you can bypass the call that makes termtosvg crash by supplying the theme option: termtosvg --theme zenburn

from termtosvg.

kaushalmodi avatar kaushalmodi commented on May 22, 2024

Could you please watch the issue and provide them with more info about your setup if needed?

Will do. Thanks.

In the meantime you can bypass the call that makes termtosvg crash by supplying the theme option: termtosvg --theme zenburn

Sorry. I still get the exact same backtrace.

km²~/.local/:bin> ./termtosvg --theme zenburn       
Recording started, enter "exit" command or Control-D to end
Traceback (most recent call last):
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 224, in __getattr__
    function = self.display_extension_methods[attr]
KeyError: 'ge_add_event_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./termtosvg", line 11, in <module>
    sys.exit(main())
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/__main__.py", line 172, in main
    columns, lines, system_theme = term.get_configuration(output_fileno)
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/term.py", line 340, in get_configuration
    xresources_str = _get_xresources()
  File "/home/kmodi/.local/lib/python3.7/site-packages/termtosvg/term.py", line 361, in _get_xresources
    d = display.Display()
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 127, in __init__
    mod.init(self, info)
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/ext/xinput.py", line 652, in init
    disp.ge_add_event_data(info.major_opcode, device_event, DeviceEventData)
  File "/home/kmodi/.local/lib/python3.7/site-packages/Xlib/display.py", line 227, in __getattr__
    raise AttributeError(attr)
AttributeError: ge_add_event_data

from termtosvg.

nbedos avatar nbedos commented on May 22, 2024

Oops, I did not think this through, sorry!

I thought getting color information from the Xserver would be useful but it may not be such a great idea after all. We'll see what the Xlib devs say about the crash. I will probably make the calls to Xlib optional, or maybe remove them completely, depending on the solution chosen to implement the font option (#3).

from termtosvg.

kaushalmodi avatar kaushalmodi commented on May 22, 2024

@nbedos This works great now. Thanks! I'll close this issue there as the ball's in the court of python-xlib now.

from termtosvg.

Related Issues (20)

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.