So I've been working on a little python application using rumps and I'd like to periodically update the title of the application in the status bar. There appears to be a function in rumps that should do what I'm looking for but I can't seem to get it to work, here's an adaption of some example code that shows the issue I'm running into:
import rumps
class AwesomeStatusBarApp(rumps.App):
def __init__(self):
super(AwesomeStatusBarApp, self).__init__("Awesome App")
self.menu = ["updating"]
@rumps.timer(1)
def sayhi(self, _):
super(AwesomeStatusBarApp, self).title(self,"Hi")
if __name__ == "__main__":
AwesomeStatusBarApp().run()
The super call in the init function works just fine, and the title function in the sayhi function should do exactly what I'm looking for, update the title and tell NSStatusBar to update it, however I'm failing with the following result:
2014-06-18 10:03:26.033 Python[29628:1107] : 'NoneType' object is not callable
And then a large traceback (Which I can provide, it just didn't format well).
I think that the error I'm running into may have something to do with the threading going on, however I'm at a loss of what to do. I tried shifting away from rumps, but I can't get NSStatusBar to work on its own, it always throws its own error. I'm looking to do something really simple, but it seems like I can never get it to work right, which is a pity.
Any help or advice is appreciated, thanks!