Merge lp:~michael-sheldon/jokosher/remove-api-console into lp:jokosher
- remove-api-console
- Merge into main
Proposed by
Michael Sheldon
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~michael-sheldon/jokosher/remove-api-console |
Merge into: | lp:jokosher |
Diff against target: |
327 lines (+0/-299) 5 files modified
extensions/eggs/APIConsole/setup.py (+0/-18) extensions/eggs/APIConsole/src/APIConsole.glade (+0/-93) extensions/eggs/APIConsole/src/APIConsole.gladep (+0/-8) extensions/eggs/APIConsole/src/APIConsole.py (+0/-179) extensions/eggs/APIConsole/src/__init__.py (+0/-1) |
To merge this branch: | bzr merge lp:~michael-sheldon/jokosher/remove-api-console |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jokosher Code | Pending | ||
Review via email: mp+20281@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote : | # |
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === removed file 'extensions/APIConsole-0.1-py2.4.egg' |
2 | Binary files extensions/APIConsole-0.1-py2.4.egg 2007-05-10 02:56:29 +0000 and extensions/APIConsole-0.1-py2.4.egg 1970-01-01 00:00:00 +0000 differ |
3 | === removed directory 'extensions/eggs/APIConsole' |
4 | === removed file 'extensions/eggs/APIConsole/setup.py' |
5 | --- extensions/eggs/APIConsole/setup.py 2006-12-21 03:28:14 +0000 |
6 | +++ extensions/eggs/APIConsole/setup.py 1970-01-01 00:00:00 +0000 |
7 | @@ -1,18 +0,0 @@ |
8 | -from setuptools import setup |
9 | -import sys, os |
10 | -from shutil import copy |
11 | -version="0.1" |
12 | -setup(name="APIConsole", |
13 | -version=version, |
14 | -description="Offers a simple console to acces the Jokosher API", |
15 | -packages=["APIConsole"], |
16 | -package_dir={"APIConsole":"src"}, |
17 | -package_data={"":["APIConsole.glade"]}, |
18 | -entry_points=""" |
19 | -[jokosher.extensions] |
20 | -extension = APIConsole:APIConsole |
21 | -""" |
22 | -) |
23 | -# copy egg file to the deployment directory in the svn structure |
24 | -copy("dist/APIConsole-%s-py%d.%d.egg" % (version,sys.version_info[0],sys.version_info[1]), |
25 | - "../../") |
26 | |
27 | === removed directory 'extensions/eggs/APIConsole/src' |
28 | === removed file 'extensions/eggs/APIConsole/src/APIConsole.glade' |
29 | --- extensions/eggs/APIConsole/src/APIConsole.glade 2007-03-22 18:08:31 +0000 |
30 | +++ extensions/eggs/APIConsole/src/APIConsole.glade 1970-01-01 00:00:00 +0000 |
31 | @@ -1,93 +0,0 @@ |
32 | -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> |
33 | -<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> |
34 | - |
35 | -<glade-interface> |
36 | - |
37 | -<widget class="GtkWindow" id="APITestDialog"> |
38 | - <property name="border_width">6</property> |
39 | - <property name="width_request">415</property> |
40 | - <property name="height_request">300</property> |
41 | - <property name="title">Jokosher API Console</property> |
42 | - <property name="type">GTK_WINDOW_TOPLEVEL</property> |
43 | - <property name="window_position">GTK_WIN_POS_CENTER</property> |
44 | - <property name="modal">False</property> |
45 | - <property name="resizable">True</property> |
46 | - <property name="destroy_with_parent">False</property> |
47 | - <property name="decorated">True</property> |
48 | - <property name="skip_taskbar_hint">False</property> |
49 | - <property name="skip_pager_hint">False</property> |
50 | - <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> |
51 | - <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> |
52 | - <property name="focus_on_map">True</property> |
53 | - <property name="urgency_hint">False</property> |
54 | - |
55 | - <child> |
56 | - <widget class="GtkVBox" id="vbox1"> |
57 | - <property name="border_width">6</property> |
58 | - <property name="visible">True</property> |
59 | - <property name="homogeneous">False</property> |
60 | - <property name="spacing">6</property> |
61 | - |
62 | - <child> |
63 | - <widget class="GtkScrolledWindow" id="scrolledwindow"> |
64 | - <property name="visible">True</property> |
65 | - <property name="hscrollbar_policy">GTK_POLICY_NEVER</property> |
66 | - <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> |
67 | - <property name="shadow_type">GTK_SHADOW_NONE</property> |
68 | - <property name="window_placement">GTK_CORNER_TOP_LEFT</property> |
69 | - |
70 | - <child> |
71 | - <widget class="GtkTextView" id="textviewOutput"> |
72 | - <property name="visible">True</property> |
73 | - <property name="editable">False</property> |
74 | - <property name="overwrite">False</property> |
75 | - <property name="accepts_tab">True</property> |
76 | - <property name="justification">GTK_JUSTIFY_LEFT</property> |
77 | - <property name="wrap_mode">GTK_WRAP_WORD</property> |
78 | - <property name="cursor_visible">True</property> |
79 | - <property name="pixels_above_lines">0</property> |
80 | - <property name="pixels_below_lines">0</property> |
81 | - <property name="pixels_inside_wrap">0</property> |
82 | - <property name="left_margin">0</property> |
83 | - <property name="right_margin">0</property> |
84 | - <property name="indent">7</property> |
85 | - <property name="text" translatable="yes"></property> |
86 | - </widget> |
87 | - </child> |
88 | - </widget> |
89 | - <packing> |
90 | - <property name="padding">0</property> |
91 | - <property name="expand">True</property> |
92 | - <property name="fill">True</property> |
93 | - </packing> |
94 | - </child> |
95 | - |
96 | - <child> |
97 | - <widget class="GtkEntry" id="entryCommand"> |
98 | - <property name="visible">True</property> |
99 | - <property name="tooltip" translatable="yes">Type a command here then press "Enter"</property> |
100 | - <property name="can_default">True</property> |
101 | - <property name="has_default">True</property> |
102 | - <property name="can_focus">True</property> |
103 | - <property name="has_focus">True</property> |
104 | - <property name="editable">True</property> |
105 | - <property name="visibility">True</property> |
106 | - <property name="max_length">0</property> |
107 | - <property name="text" translatable="yes">Type a command here then press "Enter"</property> |
108 | - <property name="has_frame">True</property> |
109 | - <property name="invisible_char">●</property> |
110 | - <property name="activates_default">True</property> |
111 | - <signal name="activate" handler="on_Activate"/> |
112 | - <signal name="key_press_event" handler="on_entryCommand_key_press_event" last_modification_time="Thu, 22 Mar 2007 17:05:05 GMT"/> |
113 | - </widget> |
114 | - <packing> |
115 | - <property name="padding">0</property> |
116 | - <property name="expand">False</property> |
117 | - <property name="fill">True</property> |
118 | - </packing> |
119 | - </child> |
120 | - </widget> |
121 | - </child> |
122 | -</widget> |
123 | - |
124 | -</glade-interface> |
125 | |
126 | === removed file 'extensions/eggs/APIConsole/src/APIConsole.gladep' |
127 | --- extensions/eggs/APIConsole/src/APIConsole.gladep 2007-02-11 02:22:56 +0000 |
128 | +++ extensions/eggs/APIConsole/src/APIConsole.gladep 1970-01-01 00:00:00 +0000 |
129 | @@ -1,8 +0,0 @@ |
130 | -<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> |
131 | -<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd"> |
132 | - |
133 | -<glade-project> |
134 | - <name></name> |
135 | - <program_name></program_name> |
136 | - <gnome_support>FALSE</gnome_support> |
137 | -</glade-project> |
138 | |
139 | === removed file 'extensions/eggs/APIConsole/src/APIConsole.py' |
140 | --- extensions/eggs/APIConsole/src/APIConsole.py 2007-05-10 02:56:29 +0000 |
141 | +++ extensions/eggs/APIConsole/src/APIConsole.py 1970-01-01 00:00:00 +0000 |
142 | @@ -1,179 +0,0 @@ |
143 | -# |
144 | -# API Console |
145 | -# ----------- |
146 | -# This extension is a simple Console for controlling jokosher via |
147 | -# the extension API. It is meant for developper use both internally |
148 | -# and externally for 3rd party extension devleloppers. Its fairly |
149 | -# simple to use: just type in an API function name |
150 | -# (e.g. add_instrument("cello", "My Cello")) and hit enter. The |
151 | -# return value (if any) is prtined back at you. rinse and repeat |
152 | -# |
153 | -#------------------------------------------------------------------------------- |
154 | - |
155 | -import Jokosher.Extension |
156 | -import gtk |
157 | -import gtk.glade |
158 | -import os |
159 | -import pkg_resources |
160 | -import Globals |
161 | - |
162 | -#========================================================================= |
163 | - |
164 | -class APIConsole: |
165 | - """ |
166 | - Displays a terminal to execute Jokosher Extension API commands. |
167 | - """ |
168 | - |
169 | - EXTENSION_NAME = "API Console" |
170 | - EXTENSION_DESCRIPTION = "Offers a simple console to acces the Jokosher API" |
171 | - EXTENSION_VERSION = "0.0.1" |
172 | - |
173 | - #_____________________________________________________________________ |
174 | - |
175 | - def startup(self, api): |
176 | - """ |
177 | - Initializes the extension. |
178 | - |
179 | - Parameters: |
180 | - api -- reference to the Jokosher extension API. |
181 | - """ |
182 | - self.api = api |
183 | - self.history = [] |
184 | - self.historyIndex = 0 |
185 | - self.menu_item = self.api.add_menu_item("API Console", self.OnMenuItemClick) |
186 | - self.defaultOutput = "dir - a list of api functions\n" + \ |
187 | - "help <function> - show documentation for a function\n" + \ |
188 | - "clear - clear text buffer\n" + \ |
189 | - "exit - close the API Console\n" + \ |
190 | - "------------------------------------\n" |
191 | - |
192 | - #_____________________________________________________________________ |
193 | - |
194 | - def shutdown(self): |
195 | - """ |
196 | - Destroys any object created by the extension when it is disabled. |
197 | - """ |
198 | - self.menu_item.destroy() |
199 | - |
200 | - #_____________________________________________________________________ |
201 | - |
202 | - def OnMenuItemClick(self, menuItem): |
203 | - """ |
204 | - Called when the user clicks on this extension's menu item. |
205 | - |
206 | - Parameters: |
207 | - menuItem -- reserved for GTK callbacks. Don't use it explicitly. |
208 | - """ |
209 | - xmlString = pkg_resources.resource_string(__name__,"APIConsole.glade") |
210 | - wTree = gtk.glade.xml_new_from_buffer(xmlString, len(xmlString),"APITestDialog") |
211 | - |
212 | - signals = { |
213 | - "on_Activate" : self.Execute, |
214 | - "on_entryCommand_key_press_event" : self.OnKeyPressCommand |
215 | - } |
216 | - wTree.signal_autoconnect(signals) |
217 | - |
218 | - self.window = wTree.get_widget("APITestDialog") |
219 | - self.command = wTree.get_widget("entryCommand") |
220 | - self.output = wTree.get_widget("textviewOutput") |
221 | - self.scrollwindow = wTree.get_widget("scrolledwindow") |
222 | - |
223 | - self.api.set_window_icon(self.window) |
224 | - self.output_text = gtk.TextBuffer() |
225 | - self.output_text.insert_at_cursor(self.defaultOutput) |
226 | - self.output.set_buffer(self.output_text) |
227 | - self.output.scroll_mark_onscreen(self.output_text.get_insert()) |
228 | - |
229 | - self.completion_model = gtk.ListStore(str) |
230 | - |
231 | - self.window.show_all() |
232 | - |
233 | - #_____________________________________________________________________ |
234 | - |
235 | - def OnKeyPressCommand(self, widget, event): |
236 | - """ |
237 | - Called when the user presses a key in the command entry. |
238 | - Used for manipulating the command history. |
239 | - |
240 | - Parameters: |
241 | - widget -- GTK widget firing this event. |
242 | - event -- keyboard event fired. |
243 | - |
244 | - Returns: |
245 | - True -- stop GTK signal propagation. |
246 | - False -- continue GTK signal propagation. |
247 | - """ |
248 | - key = gtk.gdk.keyval_name(event.keyval) |
249 | - |
250 | - if key == "Up": # up arrow: show the previous command in the history |
251 | - if len(self.history) > 0 and self.historyIndex+1 < len(self.history): |
252 | - self.historyIndex += 1 |
253 | - self.command.set_text(self.history[self.historyIndex]) |
254 | - return True |
255 | - |
256 | - elif key == "Down": # down arrow: show the next command in the history |
257 | - if len(self.history) > 0 and self.historyIndex-1 >= -1: |
258 | - self.historyIndex -= 1 |
259 | - |
260 | - if self.historyIndex >= 0: |
261 | - self.command.set_text(self.history[self.historyIndex]) |
262 | - else: |
263 | - self.command.set_text("") |
264 | - return True |
265 | - |
266 | - elif key == "Return": # enter key: create a new history entry and reset the index |
267 | - self.historyIndex = -1 |
268 | - self.history.insert(0, self.command.get_text()) |
269 | - return False |
270 | - |
271 | - else: |
272 | - return False |
273 | - |
274 | - #_____________________________________________________________________ |
275 | - |
276 | - def Execute(self, entry): |
277 | - """ |
278 | - Executes the command given by the user. |
279 | - |
280 | - Parameters: |
281 | - entry -- GTK callback parameter. |
282 | - """ |
283 | - self.output_text.insert_at_cursor(">%s\n" % self.command.get_text()) |
284 | - |
285 | - if self.command.get_text() == "dir" or self.command.get_text() == "ls": |
286 | - outputList = [] |
287 | - for method in dir(self.api): |
288 | - method = getattr(self.api, method) |
289 | - if callable(method): |
290 | - outputList.append(method.__name__) |
291 | - self.output_text.insert_at_cursor("\n".join(outputList) + "\n\n") |
292 | - |
293 | - elif self.command.get_text().startswith("help"): |
294 | - cmd = self.command.get_text()[4:].strip() |
295 | - if hasattr(self.api, cmd): |
296 | - method = getattr(self.api, cmd) |
297 | - self.output_text.insert_at_cursor("%s:\n%s\n\n" % (method.__name__, method.__doc__)) |
298 | - |
299 | - elif self.command.get_text() == "clear": |
300 | - self.output_text.set_text(self.defaultOutput) |
301 | - |
302 | - elif self.command.get_text() == "exit": |
303 | - self.window.destroy() |
304 | - |
305 | - else: |
306 | - try: |
307 | - rvalue = eval("self.api.%s" % self.command.get_text()) |
308 | - if rvalue: |
309 | - self.output_text.insert_at_cursor(str(rvalue) + "\n\n") |
310 | - except Exception, e: |
311 | - self.output_text.insert_at_cursor("Exception caught:\n%s\n\n" % e) |
312 | - |
313 | - self.command.set_text("") |
314 | - self.output.set_buffer(self.output_text) |
315 | - self.output.scroll_mark_onscreen(self.output_text.get_insert()) |
316 | - |
317 | - #_____________________________________________________________________ |
318 | - |
319 | - #You know you're a Newfie when: You think the first day of salmon fishing season is a provincial holiday |
320 | - |
321 | -#========================================================================= |
322 | |
323 | === removed file 'extensions/eggs/APIConsole/src/__init__.py' |
324 | --- extensions/eggs/APIConsole/src/__init__.py 2006-12-21 03:28:14 +0000 |
325 | +++ extensions/eggs/APIConsole/src/__init__.py 1970-01-01 00:00:00 +0000 |
326 | @@ -1,1 +0,0 @@ |
327 | -from APIConsole import * |
Removes the old API console extension.