diff options
author | Jezra <jezra@jezra.net> | 2013-07-02 07:05:51 -0700 |
---|---|---|
committer | Jezra <jezra@jezra.net> | 2013-07-02 07:05:51 -0700 |
commit | bd290f006130827b0630bf36ab058bb82f4ce29d (patch) | |
tree | 47477e0ca24ad963134d72e4d4e87d568687e9e3 /Blather.py | |
parent | 3d1a7ff6d07380af777194d1b95e2dafa65033cb (diff) |
icon, dumbass
Diffstat (limited to 'Blather.py')
-rwxr-xr-x | Blather.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Blather.py b/Blather.py index 223d417..461a456 100755 --- a/Blather.py +++ b/Blather.py @@ -49,6 +49,10 @@ class Blather: self.ui = UI(args,opts.continuous) self.ui.connect("command", self.process_command) + #can we load the icon resource? + icon = self.load_resource("icon.png") + if icon: + self.ui.set_icon(icon) if self.opts.history: self.history = [] @@ -129,7 +133,19 @@ class Blather: self.recognizer.pause() elif command == "quit": self.quit() - + + def load_resource(self,string): + local_data = os.path.join(os.path.dirname(__file__), 'data') + paths = ["/usr/share/blather/","/usr/local/share/blather", local_data] + for path in paths: + resource = os.path.join(path, string) + if os.path.exists( resource ): + return resource + #if we get this far, no resource was found + return False + + + if __name__ == "__main__": parser = OptionParser() parser.add_option("-i", "--interface", type="string", dest="interface", |