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

AttributeError: 'gi.repository.Gtk' object has no attribute 'Template' #197

Closed
ckilimci opened this issue Aug 26, 2019 · 2 comments · Fixed by #198
Closed

AttributeError: 'gi.repository.Gtk' object has no attribute 'Template' #197

ckilimci opened this issue Aug 26, 2019 · 2 comments · Fixed by #198

Comments

@ckilimci
Copy link

ckilimci commented Aug 26, 2019

Hi all,

When I guild and run, I got an error in the title. I guess, gtk version 3.0 is not enough. I saw in the Drawing.ui file, gtk+ 3.20 version is needed but in python the limitation is for 3.0.

The trace I got is like this:

~/dev/tuhi(master*) » ./builddir/tuhi.devel                                                                                                                                                  caglar@cubuntu
Running from source tree, using local files
11:02:33 DEBUG: tuhi.dbus: Bus name aquired
11:02:33 DEBUG: tuhi.ble: Adapter: /org/bluez/hci0
11:02:33 DEBUG: tuhi.ble.00:15:83:60:3C:99: Device /org/bluez/hci0/dev_00_15_83_60_3C_99 - FreematicsEMU
11:02:33 DEBUG: tuhi.ble.44:85:00:2C:41:9B: Device /org/bluez/hci0/dev_44_85_00_2C_41_9B - CPX-4F28ON5N2UQ
11:02:33 DEBUG: tuhi.ble.50:76:AF:47:1A:2F: Device /org/bluez/hci0/dev_50_76_AF_47_1A_2F - CPX-FT9F5L1LQYS
11:02:33 DEBUG: tuhi.ble.C3:66:59:F5:9A:84: Device /org/bluez/hci0/dev_C3_66_59_F5_9A_84 - Bamboo Spark
11:02:33 DEBUG: tuhi: C3:66:59:F5:9A:84: UUID fc5c755312ca protocol: spark
Running from source tree, using local files
11:02:33 DEBUG: tuhi: C3:66:59:F5:9A:84: loaded 10 drawings from disk
Traceback (most recent call last):
  File "/home/caglar/dev/tuhi/builddir/tuhi-gui.devel", line 67, in <module>
    from tuhi.gui.application import Application
  File "/home/caglar/dev/tuhi/tuhi/gui/application.py", line 17, in <module>
    from .window import MainWindow
  File "/home/caglar/dev/tuhi/tuhi/gui/window.py", line 17, in <module>
    from .drawingperspective import DrawingPerspective
  File "/home/caglar/dev/tuhi/tuhi/gui/drawingperspective.py", line 15, in <module>
    from .drawing import Drawing
  File "/home/caglar/dev/tuhi/tuhi/gui/drawing.py", line 29, in <module>
    @Gtk.Template(resource_path='/org/freedesktop/Tuhi/ui/Drawing.ui')
  File "/usr/lib/python3/dist-packages/gi/overrides/__init__.py", line 39, in __getattr__
    return getattr(self._introspection_module, name)
  File "/usr/lib/python3/dist-packages/gi/module.py", line 137, in __getattr__
    self.__name__, name))
AttributeError: 'gi.repository.Gtk' object has no attribute 'Template'

PS: I already paired with cmd line.

Best Regards,
Caglar

@whot
Copy link
Contributor

whot commented Aug 27, 2019

fwiw, the '3.0' check for the required_version is more a namespace than a real version check. I find it a bit hard to figure out what version Template was added to pygtk (this commit) but it looks like it should be in 3.30 (well, 3.29) but not in 3.28. To confirm, what does your system say when you run:

$ python3
>>> import gi
>>> gi.version_info
(3, 32, 2)

I guess you'd be on 3.28 here?

whot added a commit to whot/tuhi that referenced this issue Aug 27, 2019
This was the one that introduced the Gtk.Template class that we use. And
better to have a meaningful exit than a crash.

Fixes tuhiproject#197

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
@ckilimci
Copy link
Author

Hi Peter,

Thank you for quick response. Mine was older than 3.28. Anyway. Now it works.

Thanks again.

whot added a commit that referenced this issue Aug 27, 2019
This was the one that introduced the Gtk.Template class that we use. And
better to have a meaningful exit than a crash.

Fixes #197

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
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

Successfully merging a pull request may close this issue.

2 participants