|
@@ -49,6 +49,10 @@ class Blather:
|
49
|
49
|
|
50
|
50
|
self.ui = UI(args,opts.continuous)
|
51
|
51
|
self.ui.connect("command", self.process_command)
|
|
52
|
+ #can we load the icon resource?
|
|
53
|
+ icon = self.load_resource("icon.png")
|
|
54
|
+ if icon:
|
|
55
|
+ self.ui.set_icon(icon)
|
52
|
56
|
|
53
|
57
|
if self.opts.history:
|
54
|
58
|
self.history = []
|
|
@@ -129,7 +133,19 @@ class Blather:
|
129
|
133
|
self.recognizer.pause()
|
130
|
134
|
elif command == "quit":
|
131
|
135
|
self.quit()
|
132
|
|
-
|
|
136
|
+
|
|
137
|
+ def load_resource(self,string):
|
|
138
|
+ local_data = os.path.join(os.path.dirname(__file__), 'data')
|
|
139
|
+ paths = ["/usr/share/blather/","/usr/local/share/blather", local_data]
|
|
140
|
+ for path in paths:
|
|
141
|
+ resource = os.path.join(path, string)
|
|
142
|
+ if os.path.exists( resource ):
|
|
143
|
+ return resource
|
|
144
|
+ #if we get this far, no resource was found
|
|
145
|
+ return False
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
133
|
149
|
if __name__ == "__main__":
|
134
|
150
|
parser = OptionParser()
|
135
|
151
|
parser.add_option("-i", "--interface", type="string", dest="interface",
|