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

ooldtp has no attribute 'context' #44

Open
lucask95 opened this issue Mar 8, 2018 · 4 comments
Open

ooldtp has no attribute 'context' #44

lucask95 opened this issue Mar 8, 2018 · 4 comments

Comments

@lucask95
Copy link

lucask95 commented Mar 8, 2018

When I run ~/Documents/ldtp2/examples$ python gedit.py I get this error:

Traceback: (most recent call last):
  File "gedit.py", line 24, in <module>
    frm = ooldtp.context.('*gedit')
AttributeError: 'module' object as no attribute 'context'

I am on Ubuntu 16.05.3 LTS (Xenial)

I am able to start the python interpreter and enter >>>from ldtp import * When I do this, I get no errors, and I can enter >>>getwindowlist() successfully, and get proper results. As far as I can tell, ldtp and its dependencies are installed correctly.
When I import ldtp, I get PyGIWarnings, saying that Gtk, Atspi, and Wnck were imported without specifying a version first, and that I should use gi.require_version() before imports. Gtk and Wnck are imported in ldtpd, and Atspi is imported in pyatspi.
Would this be the reason there is no context attribute in ooldtp, and if not, why am I getting this error?

@lucask95
Copy link
Author

lucask95 commented Mar 8, 2018

I found from here that the examples will probably not work because they were written a long time ago. I assume this is the reason.

@stuaxo
Copy link
Contributor

stuaxo commented Jan 21, 2019

context seems pretty fundamental to ooldtp so it should be documented if it changed, this looks like a bug.

@stuaxo
Copy link
Contributor

stuaxo commented Jan 22, 2019

Hi @nagappan it looks like ooldtp.context was removed in this patch

e2e43c0#diff-f9376b27bbc072ac3be0fd3840cf1860

I can't see anything in the comment about changing the API, is it correct ?

@stuaxo
Copy link
Contributor

stuaxo commented Jan 22, 2019

@lucask95 installing the older ldtp 2.2.0 gets context back again

$ git checkout e10b99676
$ python setup.py build
$ python setup.py sdist
$ pip install dist/ldtp-2.2.0.tar.gz --user

The gedit example works, to make it work with the new style menu you need to change mnuQuit to btnQuit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants