Merge lp:~raoul-snyman/openlp/docstrings into lp:openlp
- docstrings
- Merge into trunk
Proposed by
Raoul Snyman
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~raoul-snyman/openlp/docstrings |
Merge into: | lp:openlp |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~raoul-snyman/openlp/docstrings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Tim Bentley | Approve | ||
Review via email:
|
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Raoul Snyman (raoul-snyman) wrote : | # |
- 524. By Raoul Snyman
-
Merged lp:~raoul-snyman/openlp/docstrings into trunk.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'documentation/source/conf.py' | |||
2 | --- documentation/source/conf.py 2009-07-10 15:45:17 +0000 | |||
3 | +++ documentation/source/conf.py 2009-09-03 21:41:34 +0000 | |||
4 | @@ -47,7 +47,7 @@ | |||
5 | 47 | # The short X.Y version. | 47 | # The short X.Y version. |
6 | 48 | version = '2.0' | 48 | version = '2.0' |
7 | 49 | # The full version, including alpha/beta/rc tags. | 49 | # The full version, including alpha/beta/rc tags. |
9 | 50 | release = '1.9.0' | 50 | release = '2.0.pre' |
10 | 51 | 51 | ||
11 | 52 | # The language for content autogenerated by Sphinx. Refer to documentation | 52 | # The language for content autogenerated by Sphinx. Refer to documentation |
12 | 53 | # for a list of supported languages. | 53 | # for a list of supported languages. |
13 | @@ -96,7 +96,14 @@ | |||
14 | 96 | # Theme options are theme-specific and customize the look and feel of a theme | 96 | # Theme options are theme-specific and customize the look and feel of a theme |
15 | 97 | # further. For a list of options available for each theme, see the | 97 | # further. For a list of options available for each theme, see the |
16 | 98 | # documentation. | 98 | # documentation. |
18 | 99 | #html_theme_options = {} | 99 | html_theme_options = { |
19 | 100 | 'sidebarbgcolor': '#3a60a9', | ||
20 | 101 | 'relbarbgcolor': '#203b6f', | ||
21 | 102 | 'footerbgcolor': '#26437c', | ||
22 | 103 | 'headtextcolor': '#203b6f', | ||
23 | 104 | 'linkcolor': '#26437c', | ||
24 | 105 | 'sidebarlinkcolor': '#ceceff' | ||
25 | 106 | } | ||
26 | 100 | 107 | ||
27 | 101 | # Add any paths that contain custom themes here, relative to this directory. | 108 | # Add any paths that contain custom themes here, relative to this directory. |
28 | 102 | #html_theme_path = [] | 109 | #html_theme_path = [] |
29 | 103 | 110 | ||
30 | === modified file 'documentation/source/core/index.rst' | |||
31 | --- documentation/source/core/index.rst 2009-07-10 15:45:17 +0000 | |||
32 | +++ documentation/source/core/index.rst 2009-09-06 18:59:21 +0000 | |||
33 | @@ -3,42 +3,9 @@ | |||
34 | 3 | :mod:`core` Module | 3 | :mod:`core` Module |
35 | 4 | ================== | 4 | ================== |
36 | 5 | 5 | ||
75 | 6 | .. automodule:: openlp.core | 6 | .. toctree:: |
76 | 7 | :members: | 7 | :maxdepth: 2 |
77 | 8 | 8 | ||
78 | 9 | :mod:`lib` Module | 9 | lib |
79 | 10 | ----------------- | 10 | theme |
42 | 11 | |||
43 | 12 | .. automodule:: openlp.core.lib | ||
44 | 13 | :members: | ||
45 | 14 | |||
46 | 15 | :mod:`baselistwithdnd` Submodule | ||
47 | 16 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
48 | 17 | |||
49 | 18 | .. automodule:: openlp.core.lib.baselistwithdnd | ||
50 | 19 | :members: | ||
51 | 20 | |||
52 | 21 | :mod:`event` Submodule | ||
53 | 22 | ^^^^^^^^^^^^^^^^^^^^^^ | ||
54 | 23 | |||
55 | 24 | .. automodule:: openlp.core.lib.event | ||
56 | 25 | :members: | ||
57 | 26 | |||
58 | 27 | :mod:`eventmanager` Submodule | ||
59 | 28 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
60 | 29 | |||
61 | 30 | .. automodule:: openlp.core.lib.eventmanager | ||
62 | 31 | :members: | ||
63 | 32 | |||
64 | 33 | :mod:`eventreceiver` Submodule | ||
65 | 34 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
66 | 35 | |||
67 | 36 | .. automodule:: openlp.core.lib.eventreceiver | ||
68 | 37 | :members: | ||
69 | 38 | |||
70 | 39 | :mod:`theme` Submodule | ||
71 | 40 | ---------------------- | ||
72 | 41 | |||
73 | 42 | .. automodule:: openlp.core.theme | ||
74 | 43 | :members: | ||
80 | 44 | 11 | ||
81 | 45 | 12 | ||
82 | === added file 'documentation/source/core/lib.rst' | |||
83 | --- documentation/source/core/lib.rst 1970-01-01 00:00:00 +0000 | |||
84 | +++ documentation/source/core/lib.rst 2009-09-06 18:59:21 +0000 | |||
85 | @@ -0,0 +1,110 @@ | |||
86 | 1 | .. _core-lib: | ||
87 | 2 | |||
88 | 3 | :mod:`lib` Module | ||
89 | 4 | ================= | ||
90 | 5 | |||
91 | 6 | Module Members | ||
92 | 7 | -------------- | ||
93 | 8 | |||
94 | 9 | .. automodule:: openlp.core.lib | ||
95 | 10 | :members: | ||
96 | 11 | |||
97 | 12 | Module Classes | ||
98 | 13 | -------------- | ||
99 | 14 | |||
100 | 15 | :mod:`BaseListWithDnD` | ||
101 | 16 | ^^^^^^^^^^^^^^^^^^^^^^ | ||
102 | 17 | |||
103 | 18 | .. autoclass:: openlp.core.lib.baselistwithdnd.BaseListWithDnD | ||
104 | 19 | :members: | ||
105 | 20 | |||
106 | 21 | :mod:`EventReceiver` | ||
107 | 22 | ^^^^^^^^^^^^^^^^^^^^ | ||
108 | 23 | |||
109 | 24 | .. autoclass:: openlp.core.lib.eventreceiver.EventReceiver | ||
110 | 25 | :members: | ||
111 | 26 | |||
112 | 27 | :mod:`ListWithPreviews` | ||
113 | 28 | ^^^^^^^^^^^^^^^^^^^^^^^ | ||
114 | 29 | |||
115 | 30 | .. autoclass:: openlp.core.lib.listwithpreviews.ListWithPreviews | ||
116 | 31 | :members: | ||
117 | 32 | |||
118 | 33 | :mod:`MediaManagerItem` | ||
119 | 34 | ^^^^^^^^^^^^^^^^^^^^^^^ | ||
120 | 35 | |||
121 | 36 | .. autoclass:: openlp.core.lib.mediamanageritem.MediaManagerItem | ||
122 | 37 | :members: | ||
123 | 38 | |||
124 | 39 | :mod:`Plugin` | ||
125 | 40 | ^^^^^^^^^^^^^ | ||
126 | 41 | |||
127 | 42 | .. autoclass:: openlp.core.lib.plugin.Plugin | ||
128 | 43 | :members: | ||
129 | 44 | |||
130 | 45 | :mod:`PluginConfig` | ||
131 | 46 | ^^^^^^^^^^^^^^^^^^^ | ||
132 | 47 | |||
133 | 48 | .. autoclass:: openlp.core.lib.pluginconfig.PluginConfig | ||
134 | 49 | :members: | ||
135 | 50 | |||
136 | 51 | :mod:`PluginManager` | ||
137 | 52 | ^^^^^^^^^^^^^^^^^^^^ | ||
138 | 53 | |||
139 | 54 | .. autoclass:: openlp.core.lib.pluginmanager.PluginManager | ||
140 | 55 | :members: | ||
141 | 56 | |||
142 | 57 | :mod:`Renderer` | ||
143 | 58 | ^^^^^^^^^^^^^^^ | ||
144 | 59 | |||
145 | 60 | .. autoclass:: openlp.core.lib.renderer.Renderer | ||
146 | 61 | :members: | ||
147 | 62 | |||
148 | 63 | :mod:`RenderManager` | ||
149 | 64 | ^^^^^^^^^^^^^^^^^^^^ | ||
150 | 65 | |||
151 | 66 | .. autoclass:: openlp.core.lib.rendermanager.RenderManager | ||
152 | 67 | :members: | ||
153 | 68 | |||
154 | 69 | :mod:`ServiceItem` | ||
155 | 70 | ^^^^^^^^^^^^^^^^^^ | ||
156 | 71 | |||
157 | 72 | .. autoclass:: openlp.core.lib.serviceitem.ServiceItem | ||
158 | 73 | :members: | ||
159 | 74 | |||
160 | 75 | :mod:`SettingsTab` | ||
161 | 76 | ^^^^^^^^^^^^^^^^^^ | ||
162 | 77 | |||
163 | 78 | .. autoclass:: openlp.core.lib.settingstab.SettingsTab | ||
164 | 79 | :members: | ||
165 | 80 | |||
166 | 81 | :mod:`SongXMLBuilder` | ||
167 | 82 | ^^^^^^^^^^^^^^^^^^^^^ | ||
168 | 83 | |||
169 | 84 | .. autoclass:: openlp.core.lib.songxmlhandler.SongXMLBuilder | ||
170 | 85 | :members: | ||
171 | 86 | |||
172 | 87 | :mod:`SongXMLParser` | ||
173 | 88 | ^^^^^^^^^^^^^^^^^^^^ | ||
174 | 89 | |||
175 | 90 | .. autoclass:: openlp.core.lib.songxmlhandler.SongXMLParser | ||
176 | 91 | :members: | ||
177 | 92 | |||
178 | 93 | :mod:`ThemeXML` | ||
179 | 94 | ^^^^^^^^^^^^^^^ | ||
180 | 95 | |||
181 | 96 | .. autoclass:: openlp.core.lib.themexmlhandler.ThemeXML | ||
182 | 97 | :members: | ||
183 | 98 | |||
184 | 99 | :mod:`OpenLPToolbar` | ||
185 | 100 | ^^^^^^^^^^^^^^^^^^^^ | ||
186 | 101 | |||
187 | 102 | .. autoclass:: openlp.core.lib.toolbar.OpenLPToolbar | ||
188 | 103 | :members: | ||
189 | 104 | |||
190 | 105 | :mod:`XmlRootClass` | ||
191 | 106 | ^^^^^^^^^^^^^^^^^^^ | ||
192 | 107 | |||
193 | 108 | .. autoclass:: openlp.core.lib.xmlrootclass.XmlRootClass | ||
194 | 109 | :members: | ||
195 | 110 | |||
196 | 0 | 111 | ||
197 | === added file 'documentation/source/core/theme.rst' | |||
198 | --- documentation/source/core/theme.rst 1970-01-01 00:00:00 +0000 | |||
199 | +++ documentation/source/core/theme.rst 2009-09-03 21:41:34 +0000 | |||
200 | @@ -0,0 +1,8 @@ | |||
201 | 1 | .. _core-theme: | ||
202 | 2 | |||
203 | 3 | :mod:`theme` Module | ||
204 | 4 | =================== | ||
205 | 5 | |||
206 | 6 | .. automodule:: openlp.core.theme | ||
207 | 7 | :members: | ||
208 | 8 | |||
209 | 0 | 9 | ||
210 | === modified file 'documentation/source/index.rst' | |||
211 | --- documentation/source/index.rst 2009-07-10 15:45:17 +0000 | |||
212 | +++ documentation/source/index.rst 2009-09-03 21:41:34 +0000 | |||
213 | @@ -3,8 +3,12 @@ | |||
214 | 3 | You can adapt this file completely to your liking, but it should at least | 3 | You can adapt this file completely to your liking, but it should at least |
215 | 4 | contain the root `toctree` directive. | 4 | contain the root `toctree` directive. |
216 | 5 | 5 | ||
219 | 6 | Welcome to OpenLP's documentation! | 6 | Welcome |
220 | 7 | ================================== | 7 | ======= |
221 | 8 | |||
222 | 9 | Welcome to the OpenLP 2.0 API Documentation! In here you will find all | ||
223 | 10 | information relating to OpenLP's core classes, core plugins, and anything else | ||
224 | 11 | deemed necessary or interesting by the developers. | ||
225 | 8 | 12 | ||
226 | 9 | Contents: | 13 | Contents: |
227 | 10 | 14 | ||
228 | 11 | 15 | ||
229 | === modified file 'documentation/source/plugins/index.rst' | |||
230 | --- documentation/source/plugins/index.rst 2009-07-10 15:45:17 +0000 | |||
231 | +++ documentation/source/plugins/index.rst 2009-09-02 20:42:57 +0000 | |||
232 | @@ -6,11 +6,10 @@ | |||
233 | 6 | .. automodule:: openlp.plugins | 6 | .. automodule:: openlp.plugins |
234 | 7 | :members: | 7 | :members: |
235 | 8 | 8 | ||
238 | 9 | :mod:`songs` Plugin | 9 | .. toctree:: |
239 | 10 | ------------------- | 10 | :maxdepth: 2 |
240 | 11 | 11 | ||
243 | 12 | .. automodule:: openlp.plugins.songs | 12 | songs |
242 | 13 | :members: | ||
244 | 14 | 13 | ||
245 | 15 | :mod:`bibles` Plugin | 14 | :mod:`bibles` Plugin |
246 | 16 | -------------------- | 15 | -------------------- |
247 | 17 | 16 | ||
248 | === added file 'documentation/source/plugins/songs.rst' | |||
249 | --- documentation/source/plugins/songs.rst 1970-01-01 00:00:00 +0000 | |||
250 | +++ documentation/source/plugins/songs.rst 2009-09-03 21:41:34 +0000 | |||
251 | @@ -0,0 +1,46 @@ | |||
252 | 1 | .. _plugins-songs: | ||
253 | 2 | |||
254 | 3 | :mod:`songs` Plugin | ||
255 | 4 | =================== | ||
256 | 5 | |||
257 | 6 | .. automodule:: openlp.plugins.songs | ||
258 | 7 | :members: | ||
259 | 8 | |||
260 | 9 | :mod:`SongsPlugin` Class | ||
261 | 10 | ------------------------ | ||
262 | 11 | |||
263 | 12 | .. autoclass:: openlp.plugins.songs.songsplugin.SongsPlugin | ||
264 | 13 | :members: | ||
265 | 14 | |||
266 | 15 | :mod:`forms` Submodule | ||
267 | 16 | ---------------------- | ||
268 | 17 | |||
269 | 18 | .. automodule:: openlp.plugins.songs.forms | ||
270 | 19 | :members: | ||
271 | 20 | |||
272 | 21 | :mod:`AuthorsForm` | ||
273 | 22 | ^^^^^^^^^^^^^^^^^^ | ||
274 | 23 | |||
275 | 24 | .. autoclass:: openlp.plugins.songs.forms.authorsdialog.Ui_AuthorsDialog | ||
276 | 25 | :members: | ||
277 | 26 | |||
278 | 27 | .. autoclass:: openlp.plugins.songs.forms.authorsform.AuthorsForm | ||
279 | 28 | :members: | ||
280 | 29 | |||
281 | 30 | :mod:`EditSongForm` | ||
282 | 31 | ^^^^^^^^^^^^^^^^^^^ | ||
283 | 32 | |||
284 | 33 | .. autoclass:: openlp.plugins.songs.forms.editsongdialog.Ui_EditSongDialog | ||
285 | 34 | :members: | ||
286 | 35 | |||
287 | 36 | .. autoclass:: openlp.plugins.songs.forms.editsongform.EditSongForm | ||
288 | 37 | :members: | ||
289 | 38 | |||
290 | 39 | :mod:`EditVerseForm` | ||
291 | 40 | ^^^^^^^^^^^^^^^^^^^^ | ||
292 | 41 | |||
293 | 42 | .. autoclass:: openlp.plugins.songs.forms.editversedialog.Ui_EditVerseDialog | ||
294 | 43 | :members: | ||
295 | 44 | |||
296 | 45 | .. autoclass:: openlp.plugins.songs.forms.editverseform.EditVerseForm | ||
297 | 46 | :members: | ||
298 | 0 | 47 | ||
299 | === modified file 'openlp.pyw' | |||
300 | --- openlp.pyw 2009-09-01 05:17:32 +0000 | |||
301 | +++ openlp.pyw 2009-09-02 20:42:57 +0000 | |||
302 | @@ -3,7 +3,9 @@ | |||
303 | 3 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 3 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
304 | 4 | """ | 4 | """ |
305 | 5 | OpenLP - Open Source Lyrics Projection | 5 | OpenLP - Open Source Lyrics Projection |
306 | 6 | |||
307 | 6 | Copyright (c) 2008 Raoul Snyman | 7 | Copyright (c) 2008 Raoul Snyman |
308 | 8 | |||
309 | 7 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, | 9 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, |
310 | 8 | 10 | ||
311 | 9 | This program is free software; you can redistribute it and/or modify it under | 11 | This program is free software; you can redistribute it and/or modify it under |
312 | @@ -29,15 +31,7 @@ | |||
313 | 29 | from openlp.core.resources import * | 31 | from openlp.core.resources import * |
314 | 30 | from openlp.core.ui import MainWindow, SplashScreen | 32 | from openlp.core.ui import MainWindow, SplashScreen |
315 | 31 | 33 | ||
316 | 32 | filename=u'openlp.log' | ||
317 | 33 | log = logging.getLogger() | 34 | log = logging.getLogger() |
318 | 34 | log.setLevel(logging.INFO) | ||
319 | 35 | |||
320 | 36 | logfile = logging.handlers.RotatingFileHandler(filename ,maxBytes=200000, backupCount=5) | ||
321 | 37 | logfile.setLevel(logging.DEBUG) | ||
322 | 38 | logfile.setFormatter(logging.Formatter(u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s')) | ||
323 | 39 | |||
324 | 40 | log.addHandler(logfile) | ||
325 | 41 | 35 | ||
326 | 42 | class OpenLP(QtGui.QApplication): | 36 | class OpenLP(QtGui.QApplication): |
327 | 43 | """ | 37 | """ |
328 | @@ -78,22 +72,40 @@ | |||
329 | 78 | self.mainWindow.show() | 72 | self.mainWindow.show() |
330 | 79 | # now kill the splashscreen | 73 | # now kill the splashscreen |
331 | 80 | self.splash.finish(self.mainWindow) | 74 | self.splash.finish(self.mainWindow) |
333 | 81 | sys.exit(app.exec_()) | 75 | sys.exit(self.exec_()) |
334 | 76 | |||
335 | 82 | 77 | ||
336 | 83 | def main(): | 78 | def main(): |
338 | 84 | usage = "usage: %prog [options] arg1 arg2" | 79 | """ |
339 | 80 | The main function which parses command line options and then runs | ||
340 | 81 | the PyQt4 Application. | ||
341 | 82 | """ | ||
342 | 83 | # Set up command line options. | ||
343 | 84 | usage = u'Usage: %prog [options] [qt-options]' | ||
344 | 85 | parser = OptionParser(usage=usage) | 85 | parser = OptionParser(usage=usage) |
347 | 86 | parser.add_option("-d", "--debug",dest="debug",action="store_true", | 86 | parser.add_option("-d", "--debug", dest="debug", |
348 | 87 | help="Switch on Debugging ") | 87 | action="store_true", help="set logging to DEBUG level") |
349 | 88 | # Set up logging | ||
350 | 89 | filename = u'openlp.log' | ||
351 | 90 | logfile = logging.handlers.RotatingFileHandler( | ||
352 | 91 | filename, maxBytes=200000, backupCount=5) | ||
353 | 92 | logfile.setFormatter( | ||
354 | 93 | logging.Formatter(u'%(asctime)s %(name)-15s %(levelname)-8s %(message)s')) | ||
355 | 94 | log.addHandler(logfile) | ||
356 | 95 | # Parse command line options and deal with them. | ||
357 | 88 | (options, args) = parser.parse_args() | 96 | (options, args) = parser.parse_args() |
358 | 89 | if options.debug is not None: | 97 | if options.debug is not None: |
359 | 90 | log.setLevel(logging.DEBUG) | 98 | log.setLevel(logging.DEBUG) |
360 | 99 | else: | ||
361 | 100 | log.setLevel(logging.INFO) | ||
362 | 101 | # Now create and actually run the application. | ||
363 | 102 | app = OpenLP(sys.argv) | ||
364 | 103 | app.run() | ||
365 | 104 | |||
366 | 91 | if __name__ == u'__main__': | 105 | if __name__ == u'__main__': |
367 | 92 | """ | 106 | """ |
368 | 93 | Instantiate and run the application. | 107 | Instantiate and run the application. |
369 | 94 | """ | 108 | """ |
370 | 109 | #import cProfile | ||
371 | 110 | #cProfile.run("main()", "profile.out") | ||
372 | 95 | main() | 111 | main() |
373 | 96 | app = OpenLP(sys.argv) | ||
374 | 97 | #import cProfile | ||
375 | 98 | #cProfile.run("app.run()", "profile.out") | ||
376 | 99 | app.run() | ||
377 | 100 | 112 | ||
378 | === modified file 'openlp/__init__.py' | |||
379 | --- openlp/__init__.py 2009-05-21 05:15:51 +0000 | |||
380 | +++ openlp/__init__.py 2009-09-02 20:42:57 +0000 | |||
381 | @@ -1,6 +1,8 @@ | |||
382 | 1 | """ | 1 | """ |
383 | 2 | OpenLP - Open Source Lyrics Projection | 2 | OpenLP - Open Source Lyrics Projection |
384 | 3 | |||
385 | 3 | Copyright (c) 2008 Raoul Snyman | 4 | Copyright (c) 2008 Raoul Snyman |
386 | 5 | |||
387 | 4 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley |
388 | 5 | 7 | ||
389 | 6 | This program is free software; you can redistribute it and/or modify it under | 8 | This program is free software; you can redistribute it and/or modify it under |
390 | 7 | 9 | ||
391 | === modified file 'openlp/core/__init__.py' | |||
392 | --- openlp/core/__init__.py 2009-07-09 05:15:26 +0000 | |||
393 | +++ openlp/core/__init__.py 2009-09-02 20:42:57 +0000 | |||
394 | @@ -2,7 +2,9 @@ | |||
395 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
396 | 3 | """ | 3 | """ |
397 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
398 | 5 | |||
399 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
400 | 7 | |||
401 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley |
402 | 7 | 9 | ||
403 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
404 | 9 | 11 | ||
405 | === modified file 'openlp/core/lib/__init__.py' | |||
406 | --- openlp/core/lib/__init__.py 2009-09-05 01:22:05 +0000 | |||
407 | +++ openlp/core/lib/__init__.py 2009-09-06 18:59:21 +0000 | |||
408 | @@ -2,7 +2,9 @@ | |||
409 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
410 | 3 | """ | 3 | """ |
411 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
412 | 5 | |||
413 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
414 | 7 | |||
415 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, | 8 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, |
416 | 7 | 9 | ||
417 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
418 | @@ -21,17 +23,51 @@ | |||
419 | 21 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
420 | 22 | 24 | ||
421 | 23 | def translate(context, text): | 25 | def translate(context, text): |
422 | 26 | """ | ||
423 | 27 | A special shortcut method to wrap around the Qt4 translation functions. | ||
424 | 28 | This abstracts the translation procedure so that we can change it if at a | ||
425 | 29 | later date if necessary, without having to redo the whole of OpenLP. | ||
426 | 30 | |||
427 | 31 | ``context`` | ||
428 | 32 | The translation context, used to give each string a context or a | ||
429 | 33 | namespace. | ||
430 | 34 | |||
431 | 35 | ``text`` | ||
432 | 36 | The text to put into the translation tables for translation. | ||
433 | 37 | """ | ||
434 | 24 | return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8) | 38 | return QtGui.QApplication.translate(context, text, None, QtGui.QApplication.UnicodeUTF8) |
435 | 25 | 39 | ||
436 | 26 | def file_to_xml(xmlfile): | 40 | def file_to_xml(xmlfile): |
437 | 41 | """ | ||
438 | 42 | Open a file and return the contents of the file. | ||
439 | 43 | |||
440 | 44 | ``xmlfile`` | ||
441 | 45 | The name of the file. | ||
442 | 46 | """ | ||
443 | 27 | return open(xmlfile).read() | 47 | return open(xmlfile).read() |
444 | 28 | 48 | ||
445 | 29 | def str_to_bool(stringvalue): | 49 | def str_to_bool(stringvalue): |
446 | 50 | """ | ||
447 | 51 | Convert a string version of a boolean into a real boolean. | ||
448 | 52 | |||
449 | 53 | ``stringvalue`` | ||
450 | 54 | The string value to examine and convert to a boolean type. | ||
451 | 55 | """ | ||
452 | 30 | if stringvalue is True or stringvalue is False: | 56 | if stringvalue is True or stringvalue is False: |
453 | 31 | return stringvalue | 57 | return stringvalue |
454 | 32 | return stringvalue.strip().lower() in (u'true', u'yes', u'y') | 58 | return stringvalue.strip().lower() in (u'true', u'yes', u'y') |
455 | 33 | 59 | ||
456 | 34 | def buildIcon(icon): | 60 | def buildIcon(icon): |
457 | 61 | """ | ||
458 | 62 | Build a QIcon instance from an existing QIcon, a resource location, or a | ||
459 | 63 | physical file location. If the icon is a QIcon instance, that icon is | ||
460 | 64 | simply returned. If not, it builds a QIcon instance from the resource or | ||
461 | 65 | file name. | ||
462 | 66 | |||
463 | 67 | ``icon`` | ||
464 | 68 | The icon to build. This can be a QIcon, a resource string in the form | ||
465 | 69 | ``:/resource/file.png``, or a file location like ``/path/to/file.png``. | ||
466 | 70 | """ | ||
467 | 35 | ButtonIcon = None | 71 | ButtonIcon = None |
468 | 36 | if type(icon) is QtGui.QIcon: | 72 | if type(icon) is QtGui.QIcon: |
469 | 37 | ButtonIcon = icon | 73 | ButtonIcon = icon |
470 | @@ -59,6 +95,7 @@ | |||
471 | 59 | action.setSeparator(True) | 95 | action.setSeparator(True) |
472 | 60 | return action | 96 | return action |
473 | 61 | 97 | ||
474 | 98 | from eventreceiver import Receiver | ||
475 | 62 | from settingsmanager import SettingsManager | 99 | from settingsmanager import SettingsManager |
476 | 63 | from pluginconfig import PluginConfig | 100 | from pluginconfig import PluginConfig |
477 | 64 | from plugin import Plugin | 101 | from plugin import Plugin |
478 | @@ -67,12 +104,10 @@ | |||
479 | 67 | from mediamanageritem import MediaManagerItem | 104 | from mediamanageritem import MediaManagerItem |
480 | 68 | from xmlrootclass import XmlRootClass | 105 | from xmlrootclass import XmlRootClass |
481 | 69 | from serviceitem import ServiceItem | 106 | from serviceitem import ServiceItem |
482 | 70 | from eventreceiver import Receiver | ||
483 | 71 | from serviceitem import ServiceType | 107 | from serviceitem import ServiceType |
484 | 72 | from serviceitem import ServiceItem | 108 | from serviceitem import ServiceItem |
485 | 73 | from toolbar import OpenLPToolbar | 109 | from toolbar import OpenLPToolbar |
488 | 74 | from songxmlhandler import SongXMLBuilder | 110 | from songxmlhandler import SongXMLBuilder, SongXMLParser |
487 | 75 | from songxmlhandler import SongXMLParser | ||
489 | 76 | from themexmlhandler import ThemeXML | 111 | from themexmlhandler import ThemeXML |
490 | 77 | from renderer import Renderer | 112 | from renderer import Renderer |
491 | 78 | from rendermanager import RenderManager | 113 | from rendermanager import RenderManager |
492 | 79 | 114 | ||
493 | === modified file 'openlp/core/lib/eventreceiver.py' | |||
494 | --- openlp/core/lib/eventreceiver.py 2009-09-05 19:58:02 +0000 | |||
495 | +++ openlp/core/lib/eventreceiver.py 2009-09-06 18:47:48 +0000 | |||
496 | @@ -24,8 +24,9 @@ | |||
497 | 24 | 24 | ||
498 | 25 | class EventReceiver(QtCore.QObject): | 25 | class EventReceiver(QtCore.QObject): |
499 | 26 | """ | 26 | """ |
502 | 27 | Class to allow events to be passed from different parts of the system. | 27 | Class to allow events to be passed from different parts of the |
503 | 28 | This is a private class and should not be used directly but via the Receiver class | 28 | system. This is a private class and should not be used directly |
504 | 29 | but rather via the Receiver class. | ||
505 | 29 | 30 | ||
506 | 30 | ``stop_import`` | 31 | ``stop_import`` |
507 | 31 | Stops the Bible Import | 32 | Stops the Bible Import |
508 | @@ -36,13 +37,13 @@ | |||
509 | 36 | ``process_events`` | 37 | ``process_events`` |
510 | 37 | Requests the Application to flush the events queue | 38 | Requests the Application to flush the events queue |
511 | 38 | 39 | ||
513 | 39 | ``{plugin}_add_service_item `` | 40 | ``{plugin}_add_service_item`` |
514 | 40 | ask the plugin to push the selected items to the service item | 41 | ask the plugin to push the selected items to the service item |
515 | 41 | 42 | ||
517 | 42 | ``update_themes `` | 43 | ``update_themes`` |
518 | 43 | send out message with new themes | 44 | send out message with new themes |
519 | 44 | 45 | ||
521 | 45 | ``update_global_theme `` | 46 | ``update_global_theme`` |
522 | 46 | Tell the components we have a new global theme | 47 | Tell the components we have a new global theme |
523 | 47 | 48 | ||
524 | 48 | ``load_song_list`` | 49 | ``load_song_list`` |
525 | @@ -78,31 +79,57 @@ | |||
526 | 78 | log = logging.getLogger(u'EventReceiver') | 79 | log = logging.getLogger(u'EventReceiver') |
527 | 79 | 80 | ||
528 | 80 | def __init__(self): | 81 | def __init__(self): |
529 | 82 | """ | ||
530 | 83 | Initialise the event receiver, calling the parent constructor. | ||
531 | 84 | """ | ||
532 | 81 | QtCore.QObject.__init__(self) | 85 | QtCore.QObject.__init__(self) |
533 | 82 | 86 | ||
534 | 83 | def send_message(self, event, msg=None): | 87 | def send_message(self, event, msg=None): |
536 | 84 | log.debug(u'Event %s passed with payload %s' % (event, msg)) | 88 | """ |
537 | 89 | Emit a Qt signal. | ||
538 | 90 | |||
539 | 91 | ``event`` | ||
540 | 92 | The event to that was sent. | ||
541 | 93 | |||
542 | 94 | ``msg`` | ||
543 | 95 | Defaults to *None*. The message to send with the event. | ||
544 | 96 | """ | ||
545 | 85 | self.emit(QtCore.SIGNAL(event), msg) | 97 | self.emit(QtCore.SIGNAL(event), msg) |
546 | 86 | 98 | ||
547 | 99 | |||
548 | 87 | class Receiver(): | 100 | class Receiver(): |
549 | 88 | """ | 101 | """ |
560 | 89 | Class to allow events to be passed from different parts of the system. | 102 | Class to allow events to be passed from different parts of the |
561 | 90 | This is a static wrapper around the EventReceiver class. | 103 | system. This is a static wrapper around the ``EventReceiver`` |
562 | 91 | As there is only one instance of it in the systems the QT signal/slot architecture | 104 | class. As there is only one instance of it in the system the QT |
563 | 92 | can send messages across the system | 105 | signal/slot architecture can send messages across the system. |
564 | 93 | 106 | ||
565 | 94 | ``Send message`` | 107 | To send a message: |
566 | 95 | Receiver().send_message(u'<<Message ID>>', data) | 108 | ``Receiver().send_message(u'<<Message ID>>', data)`` |
567 | 96 | 109 | ||
568 | 97 | ``Receive Message`` | 110 | To receive a Message |
569 | 98 | QtCore.QObject.connect(Receiver().get_receiver(),QtCore.SIGNAL(u'<<Message ID>>'),<<ACTION>>) | 111 | ``QtCore.QObject.connect(Receiver().get_receiver(), QtCore.SIGNAL(u'<<Message ID>>'), <<ACTION>>)`` |
570 | 99 | """ | 112 | """ |
571 | 100 | eventreceiver = EventReceiver() | 113 | eventreceiver = EventReceiver() |
572 | 101 | 114 | ||
573 | 102 | @staticmethod | 115 | @staticmethod |
574 | 103 | def send_message(event, msg=None): | 116 | def send_message(event, msg=None): |
575 | 117 | """ | ||
576 | 118 | Sends a message to the messaging system. | ||
577 | 119 | |||
578 | 120 | ``event`` | ||
579 | 121 | The event to send. | ||
580 | 122 | |||
581 | 123 | ``msg`` | ||
582 | 124 | Defaults to *None*. The message to send with the event. | ||
583 | 125 | """ | ||
584 | 104 | Receiver.eventreceiver.send_message(event, msg) | 126 | Receiver.eventreceiver.send_message(event, msg) |
585 | 105 | 127 | ||
586 | 106 | @staticmethod | 128 | @staticmethod |
587 | 107 | def get_receiver(): | 129 | def get_receiver(): |
588 | 130 | """ | ||
589 | 131 | Get the global ``eventreceiver`` instance. | ||
590 | 132 | """ | ||
591 | 108 | return Receiver.eventreceiver | 133 | return Receiver.eventreceiver |
592 | 134 | |||
593 | 135 | |||
594 | 109 | 136 | ||
595 | === modified file 'openlp/core/lib/mediamanageritem.py' | |||
596 | --- openlp/core/lib/mediamanageritem.py 2009-08-31 21:53:35 +0000 | |||
597 | +++ openlp/core/lib/mediamanageritem.py 2009-09-06 18:59:21 +0000 | |||
598 | @@ -31,28 +31,60 @@ | |||
599 | 31 | MediaManagerItem is a helper widget for plugins. | 31 | MediaManagerItem is a helper widget for plugins. |
600 | 32 | 32 | ||
601 | 33 | None of the following *need* to be used, feel free to override | 33 | None of the following *need* to be used, feel free to override |
624 | 34 | them cmopletely in your plugin's implementation. Alternatively, call them from your | 34 | them cmopletely in your plugin's implementation. Alternatively, |
625 | 35 | plugin before or after you've done etra things that you need to. | 35 | call them from your plugin before or after you've done extra |
626 | 36 | 36 | things that you need to. | |
627 | 37 | The plugin will be assigned an icon called u':/media/media_' + 'self.ShortPluginName + u'image.png' | 37 | |
628 | 38 | which needs to be available in the main resources in order for them to work, you need to have setup | 38 | **Constructor Parameters** |
629 | 39 | 39 | ||
630 | 40 | self.TranslationContext | 40 | ``parent`` |
631 | 41 | self.PluginTextShort # eg 'Image' for the image plugin | 41 | The parent widget. Usually this will be the *Media Manager* |
632 | 42 | self.ConfigSection - where the items in the media manager are stored | 42 | itself. This needs to be a class descended from ``QWidget``. |
633 | 43 | this could potentially be self.PluginTextShort.lower() | 43 | |
634 | 44 | 44 | ``icon`` | |
635 | 45 | self.OnNewPrompt=u'Select Image(s)' | 45 | Either a ``QIcon``, a resource path, or a file name. This is |
636 | 46 | self.OnNewFileMasks=u'Images (*.jpg *jpeg *.gif *.png *.bmp)' | 46 | the icon which is displayed in the *Media Manager*. |
637 | 47 | assumes that the new action is to load a file. If not, override onnew | 47 | |
638 | 48 | 48 | ``title`` | |
639 | 49 | self.ListViewWithDnD_class - there is a base list class with DnD assigned to it (openlp.core.lib.BaseListWithDnD()) | 49 | The title visible on the item in the *Media Manager*. |
640 | 50 | each plugin needs to inherit a class from this and pass that *class* (not an instance) to here | 50 | |
641 | 51 | via the ListViewWithDnD_class member | 51 | **Member Variables** |
642 | 52 | 52 | ||
643 | 53 | self.PreviewFunction - a function which returns a QImage to represent the item (a preview usually) | 53 | When creating a descendant class from this class for your plugin, |
644 | 54 | - no scaling required - that's done later | 54 | the following member variables should be set. |
645 | 55 | If this fn is not defined, a default will be used (treat the filename as an image) | 55 | |
646 | 56 | ``self.TranslationContext`` | ||
647 | 57 | This sets the translation context of all the text in the | ||
648 | 58 | Media Manager item. | ||
649 | 59 | |||
650 | 60 | ``self.PluginTextShort`` | ||
651 | 61 | The shortened name for the plugin, e.g. *'Image'* for the | ||
652 | 62 | image plugin. | ||
653 | 63 | |||
654 | 64 | ``self.ConfigSection`` | ||
655 | 65 | The section in the configuration where the items in the media | ||
656 | 66 | manager are stored. This could potentially be | ||
657 | 67 | ``self.PluginTextShort.lower()``. | ||
658 | 68 | |||
659 | 69 | ``self.OnNewPrompt`` | ||
660 | 70 | Defaults to *'Select Image(s)'*. | ||
661 | 71 | |||
662 | 72 | ``self.OnNewFileMasks`` | ||
663 | 73 | Defaults to *'Images (*.jpg *jpeg *.gif *.png *.bmp)'*. This | ||
664 | 74 | assumes that the new action is to load a file. If not, you | ||
665 | 75 | need to override the ``OnNew`` method. | ||
666 | 76 | |||
667 | 77 | ``self.ListViewWithDnD_class`` | ||
668 | 78 | This must be a **class**, not an object, descended from | ||
669 | 79 | ``openlp.core.lib.BaseListWithDnD`` that is not used in any | ||
670 | 80 | other part of OpenLP. | ||
671 | 81 | |||
672 | 82 | ``self.PreviewFunction`` | ||
673 | 83 | This must be a method which returns a QImage to represent the | ||
674 | 84 | item (usually a preview). No scaling is required, that is | ||
675 | 85 | performed automatically by OpenLP when necessary. If this | ||
676 | 86 | method is not defined, a default will be used (treat the | ||
677 | 87 | filename as an image). | ||
678 | 56 | """ | 88 | """ |
679 | 57 | 89 | ||
680 | 58 | global log | 90 | global log |
681 | @@ -83,12 +115,17 @@ | |||
682 | 83 | self.initialise() | 115 | self.initialise() |
683 | 84 | 116 | ||
684 | 85 | def retranslateUi(self): | 117 | def retranslateUi(self): |
685 | 118 | """ | ||
686 | 119 | This method is called automatically to provide OpenLP with the | ||
687 | 120 | opportunity to translate the ``MediaManagerItem`` to another | ||
688 | 121 | language. | ||
689 | 122 | """ | ||
690 | 86 | pass | 123 | pass |
691 | 87 | 124 | ||
692 | 88 | def addToolbar(self): | 125 | def addToolbar(self): |
693 | 89 | """ | 126 | """ |
696 | 90 | A method to help developers easily add a toolbar to the media manager | 127 | A method to help developers easily add a toolbar to the media |
697 | 91 | item. | 128 | manager item. |
698 | 92 | """ | 129 | """ |
699 | 93 | if self.Toolbar is None: | 130 | if self.Toolbar is None: |
700 | 94 | self.Toolbar = OpenLPToolbar(self) | 131 | self.Toolbar = OpenLPToolbar(self) |
701 | @@ -97,9 +134,29 @@ | |||
702 | 97 | def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None): | 134 | def addToolbarButton(self, title, tooltip, icon, slot=None, objectname=None): |
703 | 98 | """ | 135 | """ |
704 | 99 | A method to help developers easily add a button to the toolbar. | 136 | A method to help developers easily add a button to the toolbar. |
705 | 137 | |||
706 | 138 | ``title`` | ||
707 | 139 | The title of the button. | ||
708 | 140 | |||
709 | 141 | ``tooltip`` | ||
710 | 142 | The tooltip to be displayed when the mouse hovers over the | ||
711 | 143 | button. | ||
712 | 144 | |||
713 | 145 | ``icon`` | ||
714 | 146 | The icon of the button. This can be an instance of QIcon, or a | ||
715 | 147 | string cotaining either the absolute path to the image, or an | ||
716 | 148 | internal resource path starting with ':/'. | ||
717 | 149 | |||
718 | 150 | ``slot`` | ||
719 | 151 | The method to call when the button is clicked. | ||
720 | 152 | |||
721 | 153 | ``objectname`` | ||
722 | 154 | The name of the button. | ||
723 | 100 | """ | 155 | """ |
726 | 101 | # NB different order (when I broke this out, I wanted to not break compatability) | 156 | # NB different order (when I broke this out, I didn't want to |
727 | 102 | # but it makes sense for the icon to come before the tooltip (as you have to have an icon, but not neccesarily a tooltip) | 157 | # break compatability), but it makes sense for the icon to |
728 | 158 | # come before the tooltip (as you have to have an icon, but | ||
729 | 159 | # not neccesarily a tooltip) | ||
730 | 103 | self.Toolbar.addToolbarButton(title, icon, tooltip, slot, objectname) | 160 | self.Toolbar.addToolbarButton(title, icon, tooltip, slot, objectname) |
731 | 104 | 161 | ||
732 | 105 | def addToolbarSeparator(self): | 162 | def addToolbarSeparator(self): |
733 | @@ -109,6 +166,11 @@ | |||
734 | 109 | self.Toolbar.addSeparator() | 166 | self.Toolbar.addSeparator() |
735 | 110 | 167 | ||
736 | 111 | def setupUi(self): | 168 | def setupUi(self): |
737 | 169 | """ | ||
738 | 170 | This method sets up the interface on the button. Plugin | ||
739 | 171 | developers use this to add and create toolbars, and the rest | ||
740 | 172 | of the interface of the media manager item. | ||
741 | 173 | """ | ||
742 | 112 | # Add a toolbar | 174 | # Add a toolbar |
743 | 113 | self.addToolbar() | 175 | self.addToolbar() |
744 | 114 | # Create buttons for the toolbar | 176 | # Create buttons for the toolbar |
745 | @@ -189,6 +251,11 @@ | |||
746 | 189 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) | 251 | QtCore.SIGNAL(u'doubleClicked(QModelIndex)'), self.onPreviewClick) |
747 | 190 | 252 | ||
748 | 191 | def initialise(self): | 253 | def initialise(self): |
749 | 254 | """ | ||
750 | 255 | Implement this method in your descendent media manager item to | ||
751 | 256 | do any UI or other initialisation. This method is called | ||
752 | 257 | automatically. | ||
753 | 258 | """ | ||
754 | 192 | pass | 259 | pass |
755 | 193 | 260 | ||
756 | 194 | def addHeaderBar(self): | 261 | def addHeaderBar(self): |
757 | 195 | 262 | ||
758 | === modified file 'openlp/core/lib/plugin.py' | |||
759 | --- openlp/core/lib/plugin.py 2009-08-26 05:00:19 +0000 | |||
760 | +++ openlp/core/lib/plugin.py 2009-09-06 18:59:21 +0000 | |||
761 | @@ -21,17 +21,13 @@ | |||
762 | 21 | import logging | 21 | import logging |
763 | 22 | from PyQt4 import QtCore | 22 | from PyQt4 import QtCore |
764 | 23 | 23 | ||
770 | 24 | from openlp.core.lib import PluginConfig | 24 | from openlp.core.lib import PluginConfig, Receiver |
766 | 25 | # why does this not work??? | ||
767 | 26 | # from openlp.core.lib import Event, EventType | ||
768 | 27 | # so I have to do this??? | ||
769 | 28 | from eventreceiver import Receiver | ||
771 | 29 | 25 | ||
772 | 30 | class Plugin(object): | 26 | class Plugin(object): |
773 | 31 | """ | 27 | """ |
774 | 32 | Base class for openlp plugins to inherit from. | 28 | Base class for openlp plugins to inherit from. |
775 | 33 | 29 | ||
777 | 34 | Basic attributes are: | 30 | **Basic Attributes** |
778 | 35 | 31 | ||
779 | 36 | ``name`` | 32 | ``name`` |
780 | 37 | The name that should appear in the plugins list. | 33 | The name that should appear in the plugins list. |
781 | @@ -49,7 +45,7 @@ | |||
782 | 49 | ``log`` | 45 | ``log`` |
783 | 50 | A log object used to log debugging messages. This is pre-instantiated. | 46 | A log object used to log debugging messages. This is pre-instantiated. |
784 | 51 | 47 | ||
786 | 52 | Hook functions: | 48 | **Hook Functions** |
787 | 53 | 49 | ||
788 | 54 | ``check_pre_conditions()`` | 50 | ``check_pre_conditions()`` |
789 | 55 | Provides the Plugin with a handle to check if it can be loaded. | 51 | Provides the Plugin with a handle to check if it can be loaded. |
790 | @@ -201,7 +197,7 @@ | |||
791 | 201 | 197 | ||
792 | 202 | def finalise(self): | 198 | def finalise(self): |
793 | 203 | """ | 199 | """ |
795 | 204 | Called by the plugin Manager to cleanup things | 200 | Called by the plugin Manager to cleanup things. |
796 | 205 | """ | 201 | """ |
797 | 206 | pass | 202 | pass |
798 | 207 | 203 | ||
799 | 208 | 204 | ||
800 | === modified file 'openlp/core/lib/pluginconfig.py' | |||
801 | --- openlp/core/lib/pluginconfig.py 2009-09-02 01:44:09 +0000 | |||
802 | +++ openlp/core/lib/pluginconfig.py 2009-09-06 18:59:21 +0000 | |||
803 | @@ -2,7 +2,9 @@ | |||
804 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
805 | 3 | """ | 3 | """ |
806 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
807 | 5 | |||
808 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
809 | 7 | |||
810 | 6 | Portions copyright (c) 2008 -2009 Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2008 -2009 Martin Thompson, Tim Bentley |
811 | 7 | 9 | ||
812 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
813 | @@ -19,6 +21,7 @@ | |||
814 | 19 | """ | 21 | """ |
815 | 20 | 22 | ||
816 | 21 | import os | 23 | import os |
817 | 24 | |||
818 | 22 | from openlp.core.utils import ConfigHelper | 25 | from openlp.core.utils import ConfigHelper |
819 | 23 | 26 | ||
820 | 24 | class PluginConfig(object): | 27 | class PluginConfig(object): |
821 | 25 | 28 | ||
822 | === modified file 'openlp/core/lib/pluginmanager.py' | |||
823 | --- openlp/core/lib/pluginmanager.py 2009-09-05 08:52:01 +0000 | |||
824 | +++ openlp/core/lib/pluginmanager.py 2009-09-06 18:59:21 +0000 | |||
825 | @@ -2,7 +2,9 @@ | |||
826 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
827 | 3 | """ | 3 | """ |
828 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
829 | 5 | |||
830 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
831 | 7 | |||
832 | 6 | Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley, | 8 | Portions copyright (c) 2008 - 2009 Martin Thompson, Tim Bentley, |
833 | 7 | 9 | ||
834 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
835 | @@ -52,7 +54,8 @@ | |||
836 | 52 | 54 | ||
837 | 53 | def find_plugins(self, dir, plugin_helpers): | 55 | def find_plugins(self, dir, plugin_helpers): |
838 | 54 | """ | 56 | """ |
840 | 55 | Scan the directory dir for objects inheriting from ``openlp.plugin``. | 57 | Scan the directory ``dir`` for objects inheriting from the ``Plugin`` |
841 | 58 | class. | ||
842 | 56 | 59 | ||
843 | 57 | ``dir`` | 60 | ``dir`` |
844 | 58 | The directory to scan. | 61 | The directory to scan. |
845 | 59 | 62 | ||
846 | === modified file 'openlp/core/lib/renderer.py' | |||
847 | --- openlp/core/lib/renderer.py 2009-09-03 17:46:46 +0000 | |||
848 | +++ openlp/core/lib/renderer.py 2009-09-06 18:59:21 +0000 | |||
849 | @@ -2,7 +2,9 @@ | |||
850 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
851 | 3 | """ | 3 | """ |
852 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
853 | 5 | |||
854 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
855 | 7 | |||
856 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley |
857 | 7 | 9 | ||
858 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
859 | 9 | 11 | ||
860 | === modified file 'openlp/core/lib/rendermanager.py' | |||
861 | --- openlp/core/lib/rendermanager.py 2009-09-03 17:46:46 +0000 | |||
862 | +++ openlp/core/lib/rendermanager.py 2009-09-06 18:59:21 +0000 | |||
863 | @@ -2,7 +2,9 @@ | |||
864 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
865 | 3 | """ | 3 | """ |
866 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
867 | 5 | |||
868 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
869 | 7 | |||
870 | 6 | Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2008 - 2009Martin Thompson, Tim Bentley |
871 | 7 | 9 | ||
872 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
873 | @@ -31,23 +33,23 @@ | |||
874 | 31 | Class to pull all Renderer interactions into one place. The plugins will | 33 | Class to pull all Renderer interactions into one place. The plugins will |
875 | 32 | call helper methods to do the rendering but this class will provide | 34 | call helper methods to do the rendering but this class will provide |
876 | 33 | display defense code. | 35 | display defense code. |
877 | 36 | |||
878 | 37 | ``theme_manager`` | ||
879 | 38 | The ThemeManager instance, used to get the current theme details. | ||
880 | 39 | |||
881 | 40 | ``screen_list`` | ||
882 | 41 | The list of screens available. | ||
883 | 42 | |||
884 | 43 | ``screen_number`` | ||
885 | 44 | Defaults to *0*. The index of the output/display screen. | ||
886 | 34 | """ | 45 | """ |
887 | 35 | global log | 46 | global log |
889 | 36 | log=logging.getLogger(u'RenderManager') | 47 | log = logging.getLogger(u'RenderManager') |
890 | 37 | log.info(u'RenderManager Loaded') | 48 | log.info(u'RenderManager Loaded') |
891 | 38 | 49 | ||
892 | 39 | def __init__(self, theme_manager, screen_list, screen_number=0): | 50 | def __init__(self, theme_manager, screen_list, screen_number=0): |
893 | 40 | """ | 51 | """ |
894 | 41 | Initialise the render manager. | 52 | Initialise the render manager. |
895 | 42 | |||
896 | 43 | ``theme_manager`` | ||
897 | 44 | The ThemeManager instance, used to get the current theme details. | ||
898 | 45 | |||
899 | 46 | ``screen_list`` | ||
900 | 47 | The list of screens available. | ||
901 | 48 | |||
902 | 49 | ``screen_number`` | ||
903 | 50 | Defaults to *0*. The index of the output/display screen. | ||
904 | 51 | """ | 53 | """ |
905 | 52 | log.debug(u'Initilisation started') | 54 | log.debug(u'Initilisation started') |
906 | 53 | self.screen_list = screen_list | 55 | self.screen_list = screen_list |
907 | 54 | 56 | ||
908 | === modified file 'openlp/core/lib/serviceitem.py' | |||
909 | --- openlp/core/lib/serviceitem.py 2009-09-05 13:30:09 +0000 | |||
910 | +++ openlp/core/lib/serviceitem.py 2009-09-06 18:59:21 +0000 | |||
911 | @@ -2,7 +2,9 @@ | |||
912 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
913 | 3 | """ | 3 | """ |
914 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
915 | 5 | |||
916 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
917 | 7 | |||
918 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley |
919 | 7 | 9 | ||
920 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
921 | @@ -37,7 +39,7 @@ | |||
922 | 37 | compositor. | 39 | compositor. |
923 | 38 | """ | 40 | """ |
924 | 39 | global log | 41 | global log |
926 | 40 | log=logging.getLogger(u'ServiceItem') | 42 | log = logging.getLogger(u'ServiceItem') |
927 | 41 | log.info(u'Service Item created') | 43 | log.info(u'Service Item created') |
928 | 42 | 44 | ||
929 | 43 | def __init__(self, hostplugin=None): | 45 | def __init__(self, hostplugin=None): |
930 | 44 | 46 | ||
931 | === modified file 'openlp/core/lib/settingsmanager.py' | |||
932 | --- openlp/core/lib/settingsmanager.py 2009-09-06 12:13:09 +0000 | |||
933 | +++ openlp/core/lib/settingsmanager.py 2009-09-06 18:59:21 +0000 | |||
934 | @@ -2,7 +2,9 @@ | |||
935 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
936 | 3 | """ | 3 | """ |
937 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
938 | 5 | |||
939 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
940 | 7 | |||
941 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley |
942 | 7 | 9 | ||
943 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
944 | @@ -20,8 +22,9 @@ | |||
945 | 20 | 22 | ||
946 | 21 | class SettingsManager(object): | 23 | class SettingsManager(object): |
947 | 22 | """ | 24 | """ |
950 | 23 | Class to control the size of the UI components so they size correctly | 25 | Class to control the size of the UI components so they size correctly. |
951 | 24 | This class is created by the main window and then calculates the size of individual components | 26 | This class is created by the main window and then calculates the size of |
952 | 27 | individual components. | ||
953 | 25 | """ | 28 | """ |
954 | 26 | def __init__(self, screen): | 29 | def __init__(self, screen): |
955 | 27 | self.screen = screen[0] | 30 | self.screen = screen[0] |
956 | 28 | 31 | ||
957 | === modified file 'openlp/core/lib/settingstab.py' | |||
958 | --- openlp/core/lib/settingstab.py 2009-08-29 07:17:56 +0000 | |||
959 | +++ openlp/core/lib/settingstab.py 2009-09-06 18:59:21 +0000 | |||
960 | @@ -2,7 +2,9 @@ | |||
961 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
962 | 3 | """ | 3 | """ |
963 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
964 | 5 | |||
965 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
966 | 7 | |||
967 | 6 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley |
968 | 7 | 9 | ||
969 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
970 | @@ -19,6 +21,7 @@ | |||
971 | 19 | """ | 21 | """ |
972 | 20 | 22 | ||
973 | 21 | from PyQt4 import QtCore, QtGui | 23 | from PyQt4 import QtCore, QtGui |
974 | 24 | |||
975 | 22 | from openlp.core.lib import PluginConfig | 25 | from openlp.core.lib import PluginConfig |
976 | 23 | 26 | ||
977 | 24 | class SettingsTab(QtGui.QWidget): | 27 | class SettingsTab(QtGui.QWidget): |
978 | 25 | 28 | ||
979 | === modified file 'openlp/core/lib/songxmlhandler.py' | |||
980 | --- openlp/core/lib/songxmlhandler.py 2009-07-10 13:16:15 +0000 | |||
981 | +++ openlp/core/lib/songxmlhandler.py 2009-07-14 13:51:27 +0000 | |||
982 | @@ -2,7 +2,9 @@ | |||
983 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
984 | 3 | """ | 3 | """ |
985 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
986 | 5 | |||
987 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
988 | 7 | |||
989 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard | 8 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard |
990 | 7 | 9 | ||
991 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
992 | @@ -16,26 +18,25 @@ | |||
993 | 16 | You should have received a copy of the GNU General Public License along with | 18 | You should have received a copy of the GNU General Public License along with |
994 | 17 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple | 19 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
995 | 18 | Place, Suite 330, Boston, MA 02111-1307 USA | 20 | Place, Suite 330, Boston, MA 02111-1307 USA |
996 | 19 | from xml.dom.minidom import Document | ||
997 | 20 | from xml.etree.ElementTree import ElementTree, XML, dump | ||
998 | 21 | |||
999 | 22 | <?xml version="1.0" encoding="UTF-8"?> | ||
1000 | 23 | <song version="1.0"> | ||
1001 | 24 | <lyrics language="en"> | ||
1002 | 25 | <verse type="chorus" label="1"> | ||
1003 | 26 | <![CDATA[ ... ]]> | ||
1004 | 27 | </verse> | ||
1005 | 28 | </lyrics> | ||
1006 | 29 | </song> | ||
1007 | 30 | |||
1008 | 31 | """ | 21 | """ |
1009 | 32 | import logging | 22 | import logging |
1010 | 33 | from xml.dom.minidom import Document | 23 | from xml.dom.minidom import Document |
1011 | 34 | from xml.etree.ElementTree import ElementTree, XML, dump | 24 | from xml.etree.ElementTree import ElementTree, XML, dump |
1012 | 35 | 25 | ||
1014 | 36 | class SongXMLBuilder(): | 26 | class SongXMLBuilder(object): |
1015 | 37 | """ | 27 | """ |
1016 | 38 | This class builds the XML used to describe songs. | 28 | This class builds the XML used to describe songs. |
1017 | 29 | |||
1018 | 30 | The basic XML looks like this:: | ||
1019 | 31 | |||
1020 | 32 | <?xml version="1.0" encoding="UTF-8"?> | ||
1021 | 33 | <song version="1.0"> | ||
1022 | 34 | <lyrics language="en"> | ||
1023 | 35 | <verse type="chorus" label="1"> | ||
1024 | 36 | <![CDATA[ ... ]]> | ||
1025 | 37 | </verse> | ||
1026 | 38 | </lyrics> | ||
1027 | 39 | </song> | ||
1028 | 39 | """ | 40 | """ |
1029 | 40 | def __init__(self): | 41 | def __init__(self): |
1030 | 41 | """ | 42 | """ |
1031 | @@ -97,9 +98,21 @@ | |||
1032 | 97 | """ | 98 | """ |
1033 | 98 | return self.song_xml.toxml(u'utf-8') | 99 | return self.song_xml.toxml(u'utf-8') |
1034 | 99 | 100 | ||
1036 | 100 | class SongXMLParser(): | 101 | |
1037 | 102 | class SongXMLParser(object): | ||
1038 | 101 | """ | 103 | """ |
1039 | 102 | A class to read in and parse a song's XML. | 104 | A class to read in and parse a song's XML. |
1040 | 105 | |||
1041 | 106 | The basic XML looks like this:: | ||
1042 | 107 | |||
1043 | 108 | <?xml version="1.0" encoding="UTF-8"?> | ||
1044 | 109 | <song version="1.0"> | ||
1045 | 110 | <lyrics language="en"> | ||
1046 | 111 | <verse type="chorus" label="1"> | ||
1047 | 112 | <![CDATA[ ... ]]> | ||
1048 | 113 | </verse> | ||
1049 | 114 | </lyrics> | ||
1050 | 115 | </song> | ||
1051 | 103 | """ | 116 | """ |
1052 | 104 | global log | 117 | global log |
1053 | 105 | log = logging.getLogger(u'SongXMLParser') | 118 | log = logging.getLogger(u'SongXMLParser') |
1054 | 106 | 119 | ||
1055 | === modified file 'openlp/core/lib/themexmlhandler.py' | |||
1056 | --- openlp/core/lib/themexmlhandler.py 2009-09-05 01:27:38 +0000 | |||
1057 | +++ openlp/core/lib/themexmlhandler.py 2009-09-06 18:59:21 +0000 | |||
1058 | @@ -2,7 +2,9 @@ | |||
1059 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
1060 | 3 | """ | 3 | """ |
1061 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
1062 | 5 | |||
1063 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
1064 | 7 | |||
1065 | 6 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard | 8 | Portions copyright (c) 2008-2009 Martin Thompson, Tim Bentley, Carsten Tinggaard |
1066 | 7 | 9 | ||
1067 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
1068 | 9 | 11 | ||
1069 | === modified file 'openlp/core/lib/toolbar.py' | |||
1070 | --- openlp/core/lib/toolbar.py 2009-08-28 17:40:07 +0000 | |||
1071 | +++ openlp/core/lib/toolbar.py 2009-09-06 18:59:21 +0000 | |||
1072 | @@ -2,7 +2,9 @@ | |||
1073 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
1074 | 3 | """ | 3 | """ |
1075 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
1076 | 5 | |||
1077 | 5 | Copyright (c) 2009 Raoul Snyman | 6 | Copyright (c) 2009 Raoul Snyman |
1078 | 7 | |||
1079 | 6 | Portions copyright (c) 2009 Martin Thompson, Tim Bentley | 8 | Portions copyright (c) 2009 Martin Thompson, Tim Bentley |
1080 | 7 | 9 | ||
1081 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
1082 | @@ -109,9 +111,21 @@ | |||
1083 | 109 | return QtGui.QIcon() | 111 | return QtGui.QIcon() |
1084 | 110 | 112 | ||
1085 | 111 | def makeWidgetsInvisible(self, widgets): | 113 | def makeWidgetsInvisible(self, widgets): |
1086 | 114 | """ | ||
1087 | 115 | Hide a set of widgets. | ||
1088 | 116 | |||
1089 | 117 | ``widgets`` | ||
1090 | 118 | The list of names of widgets to be hidden. | ||
1091 | 119 | """ | ||
1092 | 112 | for widget in widgets: | 120 | for widget in widgets: |
1093 | 113 | self.actions[widget].setVisible(False) | 121 | self.actions[widget].setVisible(False) |
1094 | 114 | 122 | ||
1095 | 115 | def makeWidgetsVisible(self, widgets): | 123 | def makeWidgetsVisible(self, widgets): |
1096 | 124 | """ | ||
1097 | 125 | Show a set of widgets. | ||
1098 | 126 | |||
1099 | 127 | ``widgets`` | ||
1100 | 128 | The list of names of widgets to be shown. | ||
1101 | 129 | """ | ||
1102 | 116 | for widget in widgets: | 130 | for widget in widgets: |
1103 | 117 | self.actions[widget].setVisible(True) | 131 | self.actions[widget].setVisible(True) |
1104 | 118 | 132 | ||
1105 | === modified file 'openlp/core/lib/xmlrootclass.py' | |||
1106 | --- openlp/core/lib/xmlrootclass.py 2009-07-08 06:55:08 +0000 | |||
1107 | +++ openlp/core/lib/xmlrootclass.py 2009-07-14 13:51:27 +0000 | |||
1108 | @@ -2,7 +2,9 @@ | |||
1109 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 | 2 | # vim: autoindent shiftwidth=4 expandtab textwidth=80 tabstop=4 softtabstop=4 |
1110 | 3 | """ | 3 | """ |
1111 | 4 | OpenLP - Open Source Lyrics Projection | 4 | OpenLP - Open Source Lyrics Projection |
1112 | 5 | |||
1113 | 5 | Copyright (c) 2008 Raoul Snyman | 6 | Copyright (c) 2008 Raoul Snyman |
1114 | 7 | |||
1115 | 6 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Carsten Tinggaard | 8 | Portions copyright (c) 2008 Martin Thompson, Tim Bentley, Carsten Tinggaard |
1116 | 7 | 9 | ||
1117 | 8 | This program is free software; you can redistribute it and/or modify it under | 10 | This program is free software; you can redistribute it and/or modify it under |
1118 | 9 | 11 | ||
1119 | === modified file 'openlp/plugins/songs/songsplugin.py' | |||
1120 | --- openlp/plugins/songs/songsplugin.py 2009-08-26 05:00:19 +0000 | |||
1121 | +++ openlp/plugins/songs/songsplugin.py 2009-09-02 20:42:57 +0000 | |||
1122 | @@ -28,12 +28,22 @@ | |||
1123 | 28 | OpenSongImportForm, OpenLPExportForm | 28 | OpenSongImportForm, OpenLPExportForm |
1124 | 29 | 29 | ||
1125 | 30 | class SongsPlugin(Plugin): | 30 | class SongsPlugin(Plugin): |
1126 | 31 | """ | ||
1127 | 32 | This is the number 1 plugin, if importance were placed on any | ||
1128 | 33 | plugins. This plugin enables the user to create, edit and display | ||
1129 | 34 | songs. Songs are divided into verses, and the verse order can be | ||
1130 | 35 | specified. Authors, topics and song books can be assigned to songs | ||
1131 | 36 | as well. | ||
1132 | 37 | """ | ||
1133 | 31 | 38 | ||
1134 | 32 | global log | 39 | global log |
1135 | 33 | log = logging.getLogger(u'SongsPlugin') | 40 | log = logging.getLogger(u'SongsPlugin') |
1136 | 34 | log.info(u'Song Plugin loaded') | 41 | log.info(u'Song Plugin loaded') |
1137 | 35 | 42 | ||
1138 | 36 | def __init__(self, plugin_helpers): | 43 | def __init__(self, plugin_helpers): |
1139 | 44 | """ | ||
1140 | 45 | Create and set up the Songs plugin. | ||
1141 | 46 | """ | ||
1142 | 37 | # Call the parent constructor | 47 | # Call the parent constructor |
1143 | 38 | Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers) | 48 | Plugin.__init__(self, u'Songs', u'1.9.0', plugin_helpers) |
1144 | 39 | self.weight = -10 | 49 | self.weight = -10 |
1145 | @@ -48,11 +58,22 @@ | |||
1146 | 48 | QtGui.QIcon.Normal, QtGui.QIcon.Off) | 58 | QtGui.QIcon.Normal, QtGui.QIcon.Off) |
1147 | 49 | 59 | ||
1148 | 50 | def get_media_manager_item(self): | 60 | def get_media_manager_item(self): |
1150 | 51 | # Create the MediaManagerItem object | 61 | """ |
1151 | 62 | Create the MediaManagerItem object, which is displaed in the | ||
1152 | 63 | Media Manager. | ||
1153 | 64 | """ | ||
1154 | 52 | self.media_item = SongMediaItem(self, self.icon, 'Songs') | 65 | self.media_item = SongMediaItem(self, self.icon, 'Songs') |
1155 | 53 | return self.media_item | 66 | return self.media_item |
1156 | 54 | 67 | ||
1157 | 55 | def add_import_menu_item(self, import_menu): | 68 | def add_import_menu_item(self, import_menu): |
1158 | 69 | """ | ||
1159 | 70 | Give the Songs plugin the opportunity to add items to the | ||
1160 | 71 | **Import** menu. | ||
1161 | 72 | |||
1162 | 73 | ``import_menu`` | ||
1163 | 74 | The actual **Import** menu item, so that your actions can | ||
1164 | 75 | use it as their parent. | ||
1165 | 76 | """ | ||
1166 | 56 | self.ImportSongMenu = QtGui.QMenu(import_menu) | 77 | self.ImportSongMenu = QtGui.QMenu(import_menu) |
1167 | 57 | self.ImportSongMenu.setObjectName(u'ImportSongMenu') | 78 | self.ImportSongMenu.setObjectName(u'ImportSongMenu') |
1168 | 58 | self.ImportOpenSongItem = QtGui.QAction(import_menu) | 79 | self.ImportOpenSongItem = QtGui.QAction(import_menu) |
1169 | @@ -88,6 +109,14 @@ | |||
1170 | 88 | QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick) | 109 | QtCore.SIGNAL(u'triggered()'), self.onImportOpenSongItemClick) |
1171 | 89 | 110 | ||
1172 | 90 | def add_export_menu_item(self, export_menu): | 111 | def add_export_menu_item(self, export_menu): |
1173 | 112 | """ | ||
1174 | 113 | Give the Songs plugin the opportunity to add items to the | ||
1175 | 114 | **Export** menu. | ||
1176 | 115 | |||
1177 | 116 | ``export_menu`` | ||
1178 | 117 | The actual **Export** menu item, so that your actions can | ||
1179 | 118 | use it as their parent. | ||
1180 | 119 | """ | ||
1181 | 91 | self.ExportSongMenu = QtGui.QMenu(export_menu) | 120 | self.ExportSongMenu = QtGui.QMenu(export_menu) |
1182 | 92 | self.ExportSongMenu.setObjectName(u'ExportSongMenu') | 121 | self.ExportSongMenu.setObjectName(u'ExportSongMenu') |
1183 | 93 | self.ExportOpenSongItem = QtGui.QAction(export_menu) | 122 | self.ExportOpenSongItem = QtGui.QAction(export_menu) |
Some more docstrings!