AttributeError: '_GhostState' object has no attribute 'fusionner'

This is the place for queries about ThorPy issues : installation, coding, ...
buffalo
Posts: 37
Joined: Thu Feb 25, 2016 10:34 am

AttributeError: '_GhostState' object has no attribute 'fusionner'

Postby buffalo » Wed Jul 12, 2017 10:46 am

I have an indicator icon made with static png (waiting status), and an animated gif (running status).
When task is done, i want my indicator icon come back on waiting status picture.

I have this code source:

Code: Select all

activity_pics = {"waiting":"waiting_sonic.png", "running":"running_sonic.gif"}

activity_gifs = {}
for filename in activity_pics:   
    activity_gifs[filename] = thorpy.AnimatedGif.make(activity_pics[filename], colorkey=(255,255,255))
    activity_gifs[filename].resize_frames((100,100))

activity_view = activity_gifs["waiting"]

def speedsonic():   

    activity_view.frames = activity_gifs["running"].frames
    background = thorpy.Background.make(image=image_background,elements=[title_element, central_box])


def resetsonic():
    activity_view.frames = activity_gifs["waiting"].frames
    background = thorpy.Background.make(image=image_background,elements=[title_element, central_box])


speedsonic function helps me to activate my indicator icon, but resetsonic does not work to get back when work is done.
I get this traceback:

Code: Select all

menu.play()


  File "/usr/local/lib/python3.5/dist-packages/thorpy/menus/basicmenu.py", line 150, in play
    self.react_to_all_events()
  File "/usr/local/lib/python3.5/dist-packages/thorpy/menus/tickedmenu.py", line 21, in react_to_all_events
    self.treatement(event)
  File "/usr/local/lib/python3.5/dist-packages/thorpy/menus/basicmenu.py", line 131, in treatement
    self.react(event)
  File "/usr/local/lib/python3.5/dist-packages/thorpy/menus/basicmenu.py", line 116, in react
    element.react(event)
  File "/usr/local/lib/python3.5/dist-packages/thorpy/elements/ghost.py", line 286, in react
    reaction._try_activation(event)
  File "/usr/local/lib/python3.5/dist-packages/thorpy/miscgui/reaction.py", line 56, in _try_activation
    self.reac_func(**self.params)
  File "/usr/local/lib/python3.5/dist-packages/thorpy/elements/animatedgif.py", line 138, in next_frame
    self.unblit_and_reblit()
  File "/usr/local/lib/python3.5/dist-packages/thorpy/elements/ghost.py", line 375, in unblit_and_reblit
    self.unblit()
  File "/usr/local/lib/python3.5/dist-packages/thorpy/elements/element.py", line 476, in unblit
    a.partial_blit(exception=self, rect=zone)
  File "/usr/local/lib/python3.5/dist-packages/thorpy/elements/ghost.py", line 645, in partial_blit
    self.solo_blit()
  File "/usr/local/lib/python3.5/dist-packages/thorpy/elements/element.py", line 449, in solo_blit
    self.surface.blit(self.current_state.fusionner.img,
AttributeError: '_GhostState' object has no attribute 'fusionner'

ThorPy
Site Admin
Posts: 21
Joined: Wed May 13, 2015 9:44 pm

Re: AttributeError: '_GhostState' object has no attribute 'fusionner'

Postby ThorPy » Tue Jul 25, 2017 5:25 pm

Hello,

could you post the full code so that I can reproduce the bug ?


Return to “General ThorPy help”

Who is online

Users browsing this forum: No registered users and 1 guest