Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~trb143/openlp/audit |
Merge into: | lp:openlp |
Diff against target: |
548 lines 11 files modified
openlp/core/lib/renderer.py (+0/-2) openlp/core/lib/songxmlhandler.py (+2/-2) openlp/core/lib/themexmlhandler.py (+1/-1) openlp/core/theme/theme.py (+0/-8) openlp/core/ui/amendthemeform.py (+1/-1) openlp/plugins/audit/forms/auditdeleteform.py (+17/-200) openlp/plugins/bibles/lib/bibleHTTPimpl.py (+7/-22) openlp/plugins/bibles/lib/bibleOSISimpl.py (+5/-6) openlp/plugins/bibles/lib/common.py (+0/-1) openlp/plugins/bibles/lib/manager.py (+3/-3) openlp/plugins/bibles/lib/mediaitem.py (+0/-3) |
To merge this branch: | bzr merge lp:~trb143/openlp/audit |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jon Tibble (community) | 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)
Tim Bentley (trb143) wrote : | # |
Revision history for this message
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Jon Tibble (meths) wrote : | # |
Looks good, pop a space in on 423.
review:
Approve
lp:~trb143/openlp/audit
updated
- 587. By Tim Bentley
-
Bible Plugin visual change and shorten delay
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'openlp/core/lib/renderer.py' | |||
2 | --- openlp/core/lib/renderer.py 2009-09-26 12:10:41 +0000 | |||
3 | +++ openlp/core/lib/renderer.py 2009-09-26 19:20:24 +0000 | |||
4 | @@ -396,7 +396,6 @@ | |||
5 | 396 | startx = x | 396 | startx = x |
6 | 397 | starty = y | 397 | starty = y |
7 | 398 | rightextent = None | 398 | rightextent = None |
8 | 399 | #print "inputs", startx, starty, maxx, maxy | ||
9 | 400 | # dont allow alignment messing with footers | 399 | # dont allow alignment messing with footers |
10 | 401 | if footer: | 400 | if footer: |
11 | 402 | align = 0 | 401 | align = 0 |
12 | @@ -404,7 +403,6 @@ | |||
13 | 404 | else: | 403 | else: |
14 | 405 | align = int(self._theme .display_horizontalAlign) | 404 | align = int(self._theme .display_horizontalAlign) |
15 | 406 | shadow_offset = self._shadow_offset | 405 | shadow_offset = self._shadow_offset |
16 | 407 | #print lines | ||
17 | 408 | for linenum in range(len(lines)): | 406 | for linenum in range(len(lines)): |
18 | 409 | line = lines[linenum] | 407 | line = lines[linenum] |
19 | 410 | #find out how wide line is | 408 | #find out how wide line is |
20 | 411 | 409 | ||
21 | === modified file 'openlp/core/lib/songxmlhandler.py' | |||
22 | --- openlp/core/lib/songxmlhandler.py 2009-09-20 18:47:18 +0000 | |||
23 | +++ openlp/core/lib/songxmlhandler.py 2009-09-26 19:20:24 +0000 | |||
24 | @@ -93,7 +93,7 @@ | |||
25 | 93 | """ | 93 | """ |
26 | 94 | Debugging aid to dump XML so that we can see what we have. | 94 | Debugging aid to dump XML so that we can see what we have. |
27 | 95 | """ | 95 | """ |
29 | 96 | print self.song_xml.toprettyxml(indent=u' ') | 96 | return self.song_xml.toprettyxml(indent=u' ') |
30 | 97 | 97 | ||
31 | 98 | def extract_xml(self): | 98 | def extract_xml(self): |
32 | 99 | """ | 99 | """ |
33 | @@ -149,4 +149,4 @@ | |||
34 | 149 | """ | 149 | """ |
35 | 150 | Debugging aid to dump XML so that we can see what we have. | 150 | Debugging aid to dump XML so that we can see what we have. |
36 | 151 | """ | 151 | """ |
38 | 152 | print dump(self.song_xml) | 152 | return dump(self.song_xml) |
39 | 153 | 153 | ||
40 | === modified file 'openlp/core/lib/themexmlhandler.py' | |||
41 | --- openlp/core/lib/themexmlhandler.py 2009-09-25 00:43:42 +0000 | |||
42 | +++ openlp/core/lib/themexmlhandler.py 2009-09-26 19:20:24 +0000 | |||
43 | @@ -295,7 +295,7 @@ | |||
44 | 295 | Dump the XML to file. | 295 | Dump the XML to file. |
45 | 296 | """ | 296 | """ |
46 | 297 | # Debugging aid to see what we have | 297 | # Debugging aid to see what we have |
48 | 298 | print self.theme_xml.toprettyxml(indent=u' ') | 298 | return self.theme_xml.toprettyxml(indent=u' ') |
49 | 299 | 299 | ||
50 | 300 | def extract_xml(self): | 300 | def extract_xml(self): |
51 | 301 | """ | 301 | """ |
52 | 302 | 302 | ||
53 | === modified file 'openlp/core/theme/theme.py' | |||
54 | --- openlp/core/theme/theme.py 2009-09-25 00:43:42 +0000 | |||
55 | +++ openlp/core/theme/theme.py 2009-09-26 19:20:24 +0000 | |||
56 | @@ -98,7 +98,6 @@ | |||
57 | 98 | # init to defaults | 98 | # init to defaults |
58 | 99 | self._set_from_XML(blankstylexml) | 99 | self._set_from_XML(blankstylexml) |
59 | 100 | self._set_from_XML(xml) | 100 | self._set_from_XML(xml) |
60 | 101 | # print self.__str__() | ||
61 | 102 | 101 | ||
62 | 103 | def _get_as_string(self): | 102 | def _get_as_string(self): |
63 | 104 | s = u'' | 103 | s = u'' |
64 | @@ -115,23 +114,18 @@ | |||
65 | 115 | for element in iter: | 114 | for element in iter: |
66 | 116 | if element.tag != u'Theme': | 115 | if element.tag != u'Theme': |
67 | 117 | t = element.text | 116 | t = element.text |
68 | 118 | # print element.tag, t, type(t) | ||
69 | 119 | val = 0 | 117 | val = 0 |
70 | 120 | # easy! | 118 | # easy! |
71 | 121 | if type(t) == type(None): | 119 | if type(t) == type(None): |
72 | 122 | val = t | 120 | val = t |
73 | 123 | # strings need special handling to sort the colours out | 121 | # strings need special handling to sort the colours out |
74 | 124 | if type(t) is types.StringType or type(t) is types.UnicodeType: | 122 | if type(t) is types.StringType or type(t) is types.UnicodeType: |
75 | 125 | # print u'str', | ||
76 | 126 | if t[0] == u'$': # might be a hex number | 123 | if t[0] == u'$': # might be a hex number |
77 | 127 | # print u'hex', | ||
78 | 128 | try: | 124 | try: |
79 | 129 | val = int(t[1:], 16) | 125 | val = int(t[1:], 16) |
80 | 130 | except ValueError: # nope | 126 | except ValueError: # nope |
81 | 131 | # print u'nope' | ||
82 | 132 | pass | 127 | pass |
83 | 133 | elif DelphiColors.has_key(t): | 128 | elif DelphiColors.has_key(t): |
84 | 134 | # print u'colour ', t | ||
85 | 135 | val = DelphiColors[t] | 129 | val = DelphiColors[t] |
86 | 136 | else: | 130 | else: |
87 | 137 | try: | 131 | try: |
88 | @@ -142,8 +136,6 @@ | |||
89 | 142 | (element.tag.find(u'BackgroundParameter') == 0 and type(val) == type(0))): | 136 | (element.tag.find(u'BackgroundParameter') == 0 and type(val) == type(0))): |
90 | 143 | # convert to a wx.Colour | 137 | # convert to a wx.Colour |
91 | 144 | val= QtGui.QColor((val>>16) & 0xFF, (val>>8)&0xFF, val&0xFF) | 138 | val= QtGui.QColor((val>>16) & 0xFF, (val>>8)&0xFF, val&0xFF) |
92 | 145 | # print [val] | ||
93 | 146 | # print u'>> ', element.tag, val | ||
94 | 147 | setattr(self, element.tag, val) | 139 | setattr(self, element.tag, val) |
95 | 148 | 140 | ||
96 | 149 | def __str__(self): | 141 | def __str__(self): |
97 | 150 | 142 | ||
98 | === modified file 'openlp/core/ui/amendthemeform.py' | |||
99 | --- openlp/core/ui/amendthemeform.py 2009-09-25 23:06:54 +0000 | |||
100 | +++ openlp/core/ui/amendthemeform.py 2009-09-26 19:20:24 +0000 | |||
101 | @@ -194,7 +194,7 @@ | |||
102 | 194 | 194 | ||
103 | 195 | def onImageToolButtonClicked(self): | 195 | def onImageToolButtonClicked(self): |
104 | 196 | filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file') | 196 | filename = QtGui.QFileDialog.getOpenFileName(self, 'Open file') |
106 | 197 | if filename != "": | 197 | if filename != u'': |
107 | 198 | self.ImageLineEdit.setText(filename) | 198 | self.ImageLineEdit.setText(filename) |
108 | 199 | self.theme.background_filename = filename | 199 | self.theme.background_filename = filename |
109 | 200 | self.previewTheme(self.theme) | 200 | self.previewTheme(self.theme) |
110 | 201 | 201 | ||
111 | === modified file 'openlp/plugins/audit/forms/auditdeleteform.py' | |||
112 | --- openlp/plugins/audit/forms/auditdeleteform.py 2009-09-25 20:12:35 +0000 | |||
113 | +++ openlp/plugins/audit/forms/auditdeleteform.py 2009-09-26 19:20:24 +0000 | |||
114 | @@ -22,11 +22,13 @@ | |||
115 | 22 | # Temple Place, Suite 330, Boston, MA 02111-1307 USA # | 22 | # Temple Place, Suite 330, Boston, MA 02111-1307 USA # |
116 | 23 | ############################################################################### | 23 | ############################################################################### |
117 | 24 | 24 | ||
118 | 25 | from datetime import date | ||
119 | 26 | |||
120 | 25 | from PyQt4 import QtCore, QtGui | 27 | from PyQt4 import QtCore, QtGui |
121 | 26 | 28 | ||
122 | 27 | from auditdeletedialog import Ui_AuditDeleteDialog | 29 | from auditdeletedialog import Ui_AuditDeleteDialog |
123 | 28 | from openlp.core.lib import translate | 30 | from openlp.core.lib import translate |
125 | 29 | #from openlp.plugins.audit.lib.models import CustomSlide | 31 | from openlp.plugins.audit.lib import AuditManager |
126 | 30 | 32 | ||
127 | 31 | class AuditDeleteForm(QtGui.QDialog, Ui_AuditDeleteDialog): | 33 | class AuditDeleteForm(QtGui.QDialog, Ui_AuditDeleteDialog): |
128 | 32 | """ | 34 | """ |
129 | @@ -36,205 +38,20 @@ | |||
130 | 36 | """ | 38 | """ |
131 | 37 | Constructor | 39 | Constructor |
132 | 38 | """ | 40 | """ |
133 | 41 | self.auditmanager = auditmanager | ||
134 | 39 | QtGui.QDialog.__init__(self, parent) | 42 | QtGui.QDialog.__init__(self, parent) |
135 | 40 | #self.parent = parent | ||
136 | 41 | self.setupUi(self) | 43 | self.setupUi(self) |
137 | 42 | # # Connecting signals and slots | ||
138 | 43 | # QtCore.QObject.connect(self.buttonBox, | ||
139 | 44 | # QtCore.SIGNAL(u'rejected()'), self.rejected) | ||
140 | 45 | # QtCore.QObject.connect(self.buttonBox, | ||
141 | 46 | # QtCore.SIGNAL(u'accepted()'), self.accept) | ||
142 | 47 | # QtCore.QObject.connect(self.AddButton, | ||
143 | 48 | # QtCore.SIGNAL(u'pressed()'), self.onAddButtonPressed) | ||
144 | 49 | # QtCore.QObject.connect(self.EditButton, | ||
145 | 50 | # QtCore.SIGNAL(u'pressed()'), self.onEditButtonPressed) | ||
146 | 51 | # QtCore.QObject.connect(self.EditAllButton, | ||
147 | 52 | # QtCore.SIGNAL(u'pressed()'), self.onEditAllButtonPressed) | ||
148 | 53 | # QtCore.QObject.connect(self.SaveButton, | ||
149 | 54 | # QtCore.SIGNAL(u'pressed()'), self.onSaveButtonPressed) | ||
150 | 55 | # QtCore.QObject.connect(self.DeleteButton, | ||
151 | 56 | # QtCore.SIGNAL(u'pressed()'), self.onDeleteButtonPressed) | ||
152 | 57 | # QtCore.QObject.connect(self.ClearButton, | ||
153 | 58 | # QtCore.SIGNAL(u'pressed()'), self.onClearButtonPressed) | ||
154 | 59 | # QtCore.QObject.connect(self.UpButton, | ||
155 | 60 | # QtCore.SIGNAL(u'pressed()'), self.onUpButtonPressed) | ||
156 | 61 | # QtCore.QObject.connect(self.DownButton, | ||
157 | 62 | # QtCore.SIGNAL(u'pressed()'), self.onDownButtonPressed) | ||
158 | 63 | # | ||
159 | 64 | # QtCore.QObject.connect(self.VerseListView, | ||
160 | 65 | # QtCore.SIGNAL(u'itemDoubleClicked(QListWidgetItem*)'), | ||
161 | 66 | # self.onVerseListViewSelected) | ||
162 | 67 | # QtCore.QObject.connect(self.VerseListView, | ||
163 | 68 | # QtCore.SIGNAL(u'itemClicked(QListWidgetItem*)'), | ||
164 | 69 | # self.onVerseListViewPressed) | ||
165 | 70 | # QtCore.QObject.connect(Receiver.get_receiver(), | ||
166 | 71 | # QtCore.SIGNAL(u'update_themes'), self.loadThemes) | ||
167 | 72 | # # Create other objects and forms | ||
168 | 73 | # self.custommanager = custommanager | ||
169 | 74 | self.initialise() | ||
170 | 75 | 44 | ||
336 | 76 | def initialise(self): | 45 | def accept(self): |
337 | 77 | pass | 46 | ret = QtGui.QMessageBox.question(None, |
338 | 78 | # self.editAll = False | 47 | translate(u'mainWindow', u'Delete Selected Audit Events?'), |
339 | 79 | # self.DeleteButton.setEnabled(False) | 48 | translate(u'mainWindow', u'Are you sure you want to delete selected Audit Data?'), |
340 | 80 | # self.EditButton.setEnabled(False) | 49 | QtGui.QMessageBox.StandardButtons( |
341 | 81 | # self.EditAllButton.setEnabled(True) | 50 | QtGui.QMessageBox.Ok | |
342 | 82 | # self.SaveButton.setEnabled(False) | 51 | QtGui.QMessageBox.Cancel), |
343 | 83 | # self.ClearButton.setEnabled(False) | 52 | QtGui.QMessageBox.Cancel) |
344 | 84 | # self.TitleEdit.setText(u'') | 53 | if ret == QtGui.QMessageBox.Ok: |
345 | 85 | # self.CreditEdit.setText(u'') | 54 | qDeleteDate = self.DeleteCalendar.selectedDate() |
346 | 86 | # self.VerseTextEdit.clear() | 55 | deleteDate = date(qDeleteDate.year(), qDeleteDate.month(), qDeleteDate.day()) |
347 | 87 | # self.VerseListView.clear() | 56 | self.auditmanager.delete_to_date(deleteDate) |
348 | 88 | # #make sure we have a new item | 57 | self.close() |
184 | 89 | # self.customSlide = CustomSlide() | ||
185 | 90 | # self.ThemeComboBox.addItem(u'') | ||
186 | 91 | # | ||
187 | 92 | # def loadThemes(self, themelist): | ||
188 | 93 | # self.ThemeComboBox.clear() | ||
189 | 94 | # self.ThemeComboBox.addItem(u'') | ||
190 | 95 | # for themename in themelist: | ||
191 | 96 | # self.ThemeComboBox.addItem(themename) | ||
192 | 97 | # | ||
193 | 98 | # def loadCustom(self, id): | ||
194 | 99 | # self.customSlide = CustomSlide() | ||
195 | 100 | # self.initialise() | ||
196 | 101 | # if id != 0: | ||
197 | 102 | # self.customSlide = self.custommanager.get_custom(id) | ||
198 | 103 | # self.TitleEdit.setText(self.customSlide.title) | ||
199 | 104 | # self.CreditEdit.setText(self.customSlide.credits) | ||
200 | 105 | # | ||
201 | 106 | # songXML = SongXMLParser(self.customSlide.text) | ||
202 | 107 | # verseList = songXML.get_verses() | ||
203 | 108 | # for verse in verseList: | ||
204 | 109 | # self.VerseListView.addItem(verse[1]) | ||
205 | 110 | # theme = unicode(self.customSlide.theme_name) | ||
206 | 111 | # id = self.ThemeComboBox.findText(theme, QtCore.Qt.MatchExactly) | ||
207 | 112 | # if id == -1: | ||
208 | 113 | # id = 0 # Not Found | ||
209 | 114 | # self.ThemeComboBox.setCurrentIndex(id) | ||
210 | 115 | # else: | ||
211 | 116 | # self.ThemeComboBox.setCurrentIndex(0) | ||
212 | 117 | # | ||
213 | 118 | # def accept(self): | ||
214 | 119 | # valid, message = self._validate() | ||
215 | 120 | # if not valid: | ||
216 | 121 | # QtGui.QMessageBox.critical(self, | ||
217 | 122 | # translate(u'customEditDialog', u'Error'), message, | ||
218 | 123 | # QtGui.QMessageBox.StandardButtons(QtGui.QMessageBox.Ok)) | ||
219 | 124 | # return | ||
220 | 125 | # sxml = SongXMLBuilder() | ||
221 | 126 | # sxml.new_document() | ||
222 | 127 | # sxml.add_lyrics_to_song() | ||
223 | 128 | # count = 1 | ||
224 | 129 | # for i in range (0, self.VerseListView.count()): | ||
225 | 130 | # sxml.add_verse_to_lyrics( | ||
226 | 131 | # u'custom', unicode(count), | ||
227 | 132 | # unicode(self.VerseListView.item(i).text())) | ||
228 | 133 | # count += 1 | ||
229 | 134 | # self.customSlide.title = unicode(self.TitleEdit.displayText()) | ||
230 | 135 | # self.customSlide.text = unicode(sxml.extract_xml()) | ||
231 | 136 | # self.customSlide.credits = unicode(self.CreditEdit.displayText()) | ||
232 | 137 | # self.customSlide.theme_name = unicode(self.ThemeComboBox.currentText()) | ||
233 | 138 | # self.custommanager.save_slide(self.customSlide) | ||
234 | 139 | # self.close() | ||
235 | 140 | # | ||
236 | 141 | # def rejected(self): | ||
237 | 142 | # self.close() | ||
238 | 143 | # | ||
239 | 144 | # def onUpButtonPressed(self): | ||
240 | 145 | # selectedRow = self.VerseListView.currentRow() | ||
241 | 146 | # if selectedRow != 0: | ||
242 | 147 | # qw = self.VerseListView.takeItem(selectedRow) | ||
243 | 148 | # self.VerseListView.insertItem(selectedRow - 1, qw) | ||
244 | 149 | # self.VerseListView.setCurrentRow(selectedRow - 1) | ||
245 | 150 | # | ||
246 | 151 | # def onDownButtonPressed(self): | ||
247 | 152 | # selectedRow = self.VerseListView.currentRow() | ||
248 | 153 | # # zero base arrays | ||
249 | 154 | # if selectedRow != self.VerseListView.count() - 1: | ||
250 | 155 | # qw = self.VerseListView.takeItem(selectedRow) | ||
251 | 156 | # self.VerseListView.insertItem(selectedRow + 1, qw) | ||
252 | 157 | # self.VerseListView.setCurrentRow(selectedRow + 1) | ||
253 | 158 | # | ||
254 | 159 | # def onClearButtonPressed(self): | ||
255 | 160 | # self.VerseTextEdit.clear() | ||
256 | 161 | # self.editAll = False | ||
257 | 162 | # self.AddButton.setEnabled(True) | ||
258 | 163 | # self.EditAllButton.setEnabled(True) | ||
259 | 164 | # self.SaveButton.setEnabled(False) | ||
260 | 165 | # | ||
261 | 166 | # def onVerseListViewPressed(self, item): | ||
262 | 167 | # self.DeleteButton.setEnabled(True) | ||
263 | 168 | # self.EditButton.setEnabled(True) | ||
264 | 169 | # | ||
265 | 170 | # def onVerseListViewSelected(self, item): | ||
266 | 171 | # self.editText(item.text()) | ||
267 | 172 | # | ||
268 | 173 | # def onAddButtonPressed(self): | ||
269 | 174 | # self.VerseListView.addItem(self.VerseTextEdit.toPlainText()) | ||
270 | 175 | # self.DeleteButton.setEnabled(False) | ||
271 | 176 | # self.VerseTextEdit.clear() | ||
272 | 177 | # | ||
273 | 178 | # def onEditButtonPressed(self): | ||
274 | 179 | # self.editText(self.VerseListView.currentItem().text()) | ||
275 | 180 | # | ||
276 | 181 | # def onEditAllButtonPressed(self): | ||
277 | 182 | # self.editAll = True | ||
278 | 183 | # self.AddButton.setEnabled(False) | ||
279 | 184 | # if self.VerseListView.count() > 0: | ||
280 | 185 | # verse_list = u'' | ||
281 | 186 | # for row in range(0, self.VerseListView.count()): | ||
282 | 187 | # item = self.VerseListView.item(row) | ||
283 | 188 | # verse_list += item.text() | ||
284 | 189 | # verse_list += u'\n---\n' | ||
285 | 190 | # self.editText(verse_list) | ||
286 | 191 | # | ||
287 | 192 | # def editText(self, text): | ||
288 | 193 | # self.beforeText = text | ||
289 | 194 | # self.VerseTextEdit.setPlainText(text) | ||
290 | 195 | # self.DeleteButton.setEnabled(False) | ||
291 | 196 | # self.EditButton.setEnabled(False) | ||
292 | 197 | # self.EditAllButton.setEnabled(False) | ||
293 | 198 | # self.SaveButton.setEnabled(True) | ||
294 | 199 | # self.ClearButton.setEnabled(True) | ||
295 | 200 | # | ||
296 | 201 | # def onSaveButtonPressed(self): | ||
297 | 202 | # if self.editAll: | ||
298 | 203 | # self.VerseListView.clear() | ||
299 | 204 | # for row in unicode(self.VerseTextEdit.toPlainText()).split(u'\n---\n'): | ||
300 | 205 | # self.VerseListView.addItem(row) | ||
301 | 206 | # else: | ||
302 | 207 | # self.VerseListView.currentItem().setText( | ||
303 | 208 | # self.VerseTextEdit.toPlainText()) | ||
304 | 209 | # #number of lines has change | ||
305 | 210 | # if len(self.beforeText.split(u'\n')) != \ | ||
306 | 211 | # len(self.VerseTextEdit.toPlainText().split(u'\n')): | ||
307 | 212 | # tempList = {} | ||
308 | 213 | # for row in range(0, self.VerseListView.count()): | ||
309 | 214 | # tempList[row] = self.VerseListView.item(row).text() | ||
310 | 215 | # self.VerseListView.clear() | ||
311 | 216 | # for row in range (0, len(tempList)): | ||
312 | 217 | # self.VerseListView.addItem(tempList[row]) | ||
313 | 218 | # self.VerseListView.repaint() | ||
314 | 219 | # self.AddButton.setEnabled(True) | ||
315 | 220 | # self.SaveButton.setEnabled(False) | ||
316 | 221 | # self.EditButton.setEnabled(False) | ||
317 | 222 | # self.EditAllButton.setEnabled(True) | ||
318 | 223 | # self.VerseTextEdit.clear() | ||
319 | 224 | # | ||
320 | 225 | # def onDeleteButtonPressed(self): | ||
321 | 226 | # self.VerseListView.takeItem(self.VerseListView.currentRow()) | ||
322 | 227 | # self.EditButton.setEnabled(False) | ||
323 | 228 | # self.EditAllButton.setEnabled(True) | ||
324 | 229 | # | ||
325 | 230 | # def _validate(self): | ||
326 | 231 | # if len(self.TitleEdit.displayText()) == 0: | ||
327 | 232 | # self.TitleEdit.setFocus() | ||
328 | 233 | # return False, translate( | ||
329 | 234 | # u'customEditDialog', u'You need to enter a title \n') | ||
330 | 235 | # # must have 1 slide | ||
331 | 236 | # if self.VerseListView.count() == 0: | ||
332 | 237 | # self.VerseTextEdit.setFocus() | ||
333 | 238 | # return False, translate( | ||
334 | 239 | # u'customEditDialog', u'You need to enter a slide \n') | ||
335 | 240 | # return True, u'' | ||
349 | 241 | 58 | ||
350 | === modified file 'openlp/plugins/bibles/lib/bibleHTTPimpl.py' | |||
351 | --- openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-09-25 23:06:54 +0000 | |||
352 | +++ openlp/plugins/bibles/lib/bibleHTTPimpl.py 2009-09-26 19:20:24 +0000 | |||
353 | @@ -57,28 +57,23 @@ | |||
354 | 57 | unicode(bookid) + u'&chapter' + unicode(chapter) + u'&version=' + \ | 57 | unicode(bookid) + u'&chapter' + unicode(chapter) + u'&version=' + \ |
355 | 58 | unicode(version) | 58 | unicode(version) |
356 | 59 | xml_string = self._get_web_text(urlstring, self.proxyurl) | 59 | xml_string = self._get_web_text(urlstring, self.proxyurl) |
357 | 60 | #print xml_string | ||
358 | 61 | VerseSearch = u'class=' + u'"' + u'sup' + u'"' + u'>' | 60 | VerseSearch = u'class=' + u'"' + u'sup' + u'"' + u'>' |
359 | 62 | verse = 1 | 61 | verse = 1 |
360 | 63 | i = xml_string.find(u'result-text-style-normal') | 62 | i = xml_string.find(u'result-text-style-normal') |
361 | 64 | xml_string = xml_string[i:len(xml_string)] | 63 | xml_string = xml_string[i:len(xml_string)] |
362 | 65 | versePos = xml_string.find(VerseSearch) | 64 | versePos = xml_string.find(VerseSearch) |
363 | 66 | #print versePos | ||
364 | 67 | bible = {} | 65 | bible = {} |
365 | 68 | while versePos > -1: | 66 | while versePos > -1: |
367 | 69 | verseText = '' # clear out string | 67 | # clear out string |
368 | 68 | verseText = '' | ||
369 | 70 | versePos = xml_string.find(u'</span', versePos) | 69 | versePos = xml_string.find(u'</span', versePos) |
370 | 71 | i = xml_string.find(VerseSearch, versePos+1) | 70 | i = xml_string.find(VerseSearch, versePos+1) |
371 | 72 | #print i, versePos | ||
372 | 73 | if i == -1: | 71 | if i == -1: |
373 | 74 | i = xml_string.find(u'</div', versePos+1) | 72 | i = xml_string.find(u'</div', versePos+1) |
374 | 75 | j = xml_string.find(u'<strong', versePos+1) | 73 | j = xml_string.find(u'<strong', versePos+1) |
375 | 76 | #print i, j | ||
376 | 77 | if j > 0 and j < i: | 74 | if j > 0 and j < i: |
377 | 78 | i = j | 75 | i = j |
378 | 79 | verseText = xml_string[versePos + 7 : i ] | 76 | verseText = xml_string[versePos + 7 : i ] |
379 | 80 | #print xml_string | ||
380 | 81 | #print 'VerseText = ' + unicode(verse) +' '+ verseText | ||
381 | 82 | bible[verse] = self._clean_text(verseText) # store the verse | 77 | bible[verse] = self._clean_text(verseText) # store the verse |
382 | 83 | versePos = -1 | 78 | versePos = -1 |
383 | 84 | else: | 79 | else: |
384 | @@ -121,9 +116,9 @@ | |||
385 | 121 | log.debug(u'get_bible_chapter %s,%s,%s,%s', | 116 | log.debug(u'get_bible_chapter %s,%s,%s,%s', |
386 | 122 | version, bookid, bookname, chapter) | 117 | version, bookid, bookname, chapter) |
387 | 123 | bookname = bookname.replace(u' ', u'') | 118 | bookname = bookname.replace(u' ', u'') |
389 | 124 | urlstring = u'http://bible.crosswalk.com/OnlineStudyBible/bible.cgi?word=%s+%d&version=%s' % (bookname, chapter, version) | 119 | urlstring = u'http://bible.crosswalk.com/OnlineStudyBible/bible.cgi?word=%s+%d&version=%s'\ |
390 | 120 | % (bookname, chapter, version) | ||
391 | 125 | xml_string = self._get_web_text(urlstring, self.proxyurl) | 121 | xml_string = self._get_web_text(urlstring, self.proxyurl) |
392 | 126 | #log.debug(u'Return data %s', xml_string) | ||
393 | 127 | ## Strip Book Title from Heading to return it to system | 122 | ## Strip Book Title from Heading to return it to system |
394 | 128 | ## | 123 | ## |
395 | 129 | i= xml_string.find(u'<title>') | 124 | i= xml_string.find(u'<title>') |
396 | @@ -136,11 +131,8 @@ | |||
397 | 136 | book_title = book_title[:i].rstrip() | 131 | book_title = book_title[:i].rstrip() |
398 | 137 | log.debug(u'Book Title %s', book_title) | 132 | log.debug(u'Book Title %s', book_title) |
399 | 138 | log.debug(u'Book Chapter %s', book_chapter) | 133 | log.debug(u'Book Chapter %s', book_chapter) |
400 | 134 | # Strip Verse Data from Page and build an array | ||
401 | 139 | 135 | ||
402 | 140 | ## Strip Verse Data from Page and build an array | ||
403 | 141 | ## | ||
404 | 142 | #log.debug(u'bible data %s', xml_string) | ||
405 | 143 | #print xml_string | ||
406 | 144 | i= xml_string.find(u'NavCurrentChapter') | 136 | i= xml_string.find(u'NavCurrentChapter') |
407 | 145 | xml_string = xml_string[i:len(xml_string)] | 137 | xml_string = xml_string[i:len(xml_string)] |
408 | 146 | i= xml_string.find(u'<TABLE') | 138 | i= xml_string.find(u'<TABLE') |
409 | @@ -153,15 +145,13 @@ | |||
410 | 153 | #remove the <B> at the front | 145 | #remove the <B> at the front |
411 | 154 | xml_string = xml_string[i + 3 :len(xml_string)] | 146 | xml_string = xml_string[i + 3 :len(xml_string)] |
412 | 155 | versePos = xml_string.find(u'<BLOCKQUOTE>') | 147 | versePos = xml_string.find(u'<BLOCKQUOTE>') |
413 | 156 | #log.debug(u'verse pos %d', versePos) | ||
414 | 157 | bible = {} | 148 | bible = {} |
415 | 158 | while versePos > 0: | 149 | while versePos > 0: |
416 | 159 | verseText = u'' | 150 | verseText = u'' |
417 | 160 | versePos = xml_string.find(u'<B><I>', versePos) + 6 | 151 | versePos = xml_string.find(u'<B><I>', versePos) + 6 |
418 | 161 | i = xml_string.find(u'</I></B>', versePos) | 152 | i = xml_string.find(u'</I></B>', versePos) |
422 | 162 | #log.debug( versePos, i) | 153 | # Got the Chapter |
423 | 163 | verse= xml_string[versePos:i] # Got the Chapter | 154 | verse= xml_string[versePos:i] |
421 | 164 | #log.debug( 'Chapter = %s', verse) | ||
424 | 165 | # move the starting position to begining of the text | 155 | # move the starting position to begining of the text |
425 | 166 | versePos = i + 8 | 156 | versePos = i + 8 |
426 | 167 | # find the start of the next verse | 157 | # find the start of the next verse |
427 | @@ -171,14 +161,9 @@ | |||
428 | 171 | verseText = xml_string[versePos: i] | 161 | verseText = xml_string[versePos: i] |
429 | 172 | versePos = 0 | 162 | versePos = 0 |
430 | 173 | else: | 163 | else: |
431 | 174 | #log.debug( i, versePos) | ||
432 | 175 | verseText = xml_string[versePos: i] | 164 | verseText = xml_string[versePos: i] |
433 | 176 | versePos = i | 165 | versePos = i |
434 | 177 | #print verseText | ||
435 | 178 | #print self._clean_text(verseText) | ||
436 | 179 | bible[verse] = self._clean_text(verseText) | 166 | bible[verse] = self._clean_text(verseText) |
437 | 180 | |||
438 | 181 | #log.debug( bible) | ||
439 | 182 | return SearchResults(book_title, book_chapter, bible) | 167 | return SearchResults(book_title, book_chapter, bible) |
440 | 183 | 168 | ||
441 | 184 | class BibleHTTPImpl(): | 169 | class BibleHTTPImpl(): |
442 | 185 | 170 | ||
443 | === modified file 'openlp/plugins/bibles/lib/bibleOSISimpl.py' | |||
444 | --- openlp/plugins/bibles/lib/bibleOSISimpl.py 2009-09-25 23:06:54 +0000 | |||
445 | +++ openlp/plugins/bibles/lib/bibleOSISimpl.py 2009-09-26 19:20:24 +0000 | |||
446 | @@ -30,7 +30,7 @@ | |||
447 | 30 | 30 | ||
448 | 31 | from PyQt4 import QtCore | 31 | from PyQt4 import QtCore |
449 | 32 | 32 | ||
451 | 33 | from openlp.core.lib import Receiver | 33 | from openlp.core.lib import translate, Receiver |
452 | 34 | 34 | ||
453 | 35 | class BibleOSISImpl(): | 35 | class BibleOSISImpl(): |
454 | 36 | """ | 36 | """ |
455 | @@ -51,6 +51,7 @@ | |||
456 | 51 | ``bibledb`` | 51 | ``bibledb`` |
457 | 52 | A reference to a Bible database object. | 52 | A reference to a Bible database object. |
458 | 53 | """ | 53 | """ |
459 | 54 | log.info(u'BibleOSISImpl Initialising') | ||
460 | 54 | self.bibledb = bibledb | 55 | self.bibledb = bibledb |
461 | 55 | # books of the bible linked to bibleid {osis , name} | 56 | # books of the bible linked to bibleid {osis , name} |
462 | 56 | self.booksOfBible = {} | 57 | self.booksOfBible = {} |
463 | @@ -90,7 +91,6 @@ | |||
464 | 90 | detect_file.close() | 91 | detect_file.close() |
465 | 91 | osis = codecs.open(osisfile_record, u'r', details['encoding']) | 92 | osis = codecs.open(osisfile_record, u'r', details['encoding']) |
466 | 92 | book_ptr = None | 93 | book_ptr = None |
467 | 93 | #id = 0 | ||
468 | 94 | count = 0 | 94 | count = 0 |
469 | 95 | verseText = u'<verse osisID=' | 95 | verseText = u'<verse osisID=' |
470 | 96 | testament = 1 | 96 | testament = 1 |
471 | @@ -123,7 +123,6 @@ | |||
472 | 123 | while pos > -1: | 123 | while pos > -1: |
473 | 124 | epos = text.find(u'<Fi>', pos) | 124 | epos = text.find(u'<Fi>', pos) |
474 | 125 | if epos == -1: # TODO | 125 | if epos == -1: # TODO |
475 | 126 | #print "Y", search_text, e | ||
476 | 127 | pos = -1 | 126 | pos = -1 |
477 | 128 | else: | 127 | else: |
478 | 129 | text = text[:pos] + text[epos + 4: ] | 128 | text = text[:pos] + text[epos + 4: ] |
479 | @@ -132,7 +131,6 @@ | |||
480 | 132 | while pos > -1: | 131 | while pos > -1: |
481 | 133 | epos = text.find(u'<Rf>', pos) | 132 | epos = text.find(u'<Rf>', pos) |
482 | 134 | text = text[:pos] + text[epos + 4: ] | 133 | text = text[:pos] + text[epos + 4: ] |
483 | 135 | #print "X", pos, epos, text | ||
484 | 136 | pos = text.find(u'<RF>') | 134 | pos = text.find(u'<RF>') |
485 | 137 | # split up the reference | 135 | # split up the reference |
486 | 138 | p = ref.split(u'.', 3) | 136 | p = ref.split(u'.', 3) |
487 | @@ -149,8 +147,9 @@ | |||
488 | 149 | testament += 1 | 147 | testament += 1 |
489 | 150 | book_ptr = p[0] | 148 | book_ptr = p[0] |
490 | 151 | book = self.bibledb.create_book( | 149 | book = self.bibledb.create_book( |
493 | 152 | self.booksOfBible[p[0]], | 150 | unicode(translate(u'BibleBooks', self.booksOfBible[p[0]])), |
494 | 153 | self.abbrevOfBible[p[0]], testament) | 151 | unicode(translate(u'BibleBooks', self.abbrevOfBible[p[0]])), |
495 | 152 | testament) | ||
496 | 154 | dialogobject.incrementProgressBar( | 153 | dialogobject.incrementProgressBar( |
497 | 155 | self.booksOfBible[p[0]]) | 154 | self.booksOfBible[p[0]]) |
498 | 156 | Receiver().send_message(u'process_events') | 155 | Receiver().send_message(u'process_events') |
499 | 157 | 156 | ||
500 | === modified file 'openlp/plugins/bibles/lib/common.py' | |||
501 | --- openlp/plugins/bibles/lib/common.py 2009-09-25 00:43:42 +0000 | |||
502 | +++ openlp/plugins/bibles/lib/common.py 2009-09-26 19:20:24 +0000 | |||
503 | @@ -153,7 +153,6 @@ | |||
504 | 153 | text = text.replace(u'</P>', u'') | 153 | text = text.replace(u'</P>', u'') |
505 | 154 | text = text.replace(u'<BR>', u'') | 154 | text = text.replace(u'<BR>', u'') |
506 | 155 | text = text.replace(u'<BR />', u'') | 155 | text = text.replace(u'<BR />', u'') |
507 | 156 | #text = text.replace(chr(189), u'1/2');print "l" | ||
508 | 157 | text = text.replace(u'"', u'\"') | 156 | text = text.replace(u'"', u'\"') |
509 | 158 | text = text.replace(u''', u'\'') | 157 | text = text.replace(u''', u'\'') |
510 | 159 | # Remove some other tags | 158 | # Remove some other tags |
511 | 160 | 159 | ||
512 | === modified file 'openlp/plugins/bibles/lib/manager.py' | |||
513 | --- openlp/plugins/bibles/lib/manager.py 2009-09-25 23:06:54 +0000 | |||
514 | +++ openlp/plugins/bibles/lib/manager.py 2009-09-26 19:20:24 +0000 | |||
515 | @@ -177,14 +177,14 @@ | |||
516 | 177 | nbible.save_meta(u'WEB', biblesource) | 177 | nbible.save_meta(u'WEB', biblesource) |
517 | 178 | # store the web id of the bible | 178 | # store the web id of the bible |
518 | 179 | nbible.save_meta(u'bibleid', bibleid) | 179 | nbible.save_meta(u'bibleid', bibleid) |
520 | 180 | if proxyurl is not None and proxyurl != "": | 180 | if proxyurl is not None and proxyurl != u'': |
521 | 181 | # store the proxy URL | 181 | # store the proxy URL |
522 | 182 | nbible.save_meta(u'proxy', proxyurl) | 182 | nbible.save_meta(u'proxy', proxyurl) |
523 | 183 | nhttp.set_proxy(proxyurl) | 183 | nhttp.set_proxy(proxyurl) |
525 | 184 | if proxyid is not None and proxyid != "": | 184 | if proxyid is not None and proxyid != u'': |
526 | 185 | # store the proxy userid | 185 | # store the proxy userid |
527 | 186 | nbible.save_meta(u'proxyid', proxyid) | 186 | nbible.save_meta(u'proxyid', proxyid) |
529 | 187 | if proxypass is not None and proxypass != "": | 187 | if proxypass is not None and proxypass != u'': |
530 | 188 | # store the proxy password | 188 | # store the proxy password |
531 | 189 | nbible.save_meta(u'proxypass', proxypass) | 189 | nbible.save_meta(u'proxypass', proxypass) |
532 | 190 | return True | 190 | return True |
533 | 191 | 191 | ||
534 | === modified file 'openlp/plugins/bibles/lib/mediaitem.py' | |||
535 | --- openlp/plugins/bibles/lib/mediaitem.py 2009-09-26 12:10:41 +0000 | |||
536 | +++ openlp/plugins/bibles/lib/mediaitem.py 2009-09-26 19:20:24 +0000 | |||
537 | @@ -474,11 +474,8 @@ | |||
538 | 474 | start_chapter = chapter | 474 | start_chapter = chapter |
539 | 475 | else: | 475 | else: |
540 | 476 | # more complex | 476 | # more complex |
541 | 477 | #print search | ||
542 | 478 | sp = search.split(u'-') #find first | 477 | sp = search.split(u'-') #find first |
543 | 479 | #print sp, len(sp) | ||
544 | 480 | sp1 = sp[0].split(u':') | 478 | sp1 = sp[0].split(u':') |
545 | 481 | #print sp1, len(sp1) | ||
546 | 482 | if len(sp1) == 1: | 479 | if len(sp1) == 1: |
547 | 483 | start_chapter = sp1[0] | 480 | start_chapter = sp1[0] |
548 | 484 | start_verse = 1 | 481 | start_verse = 1 |
Audit will now delete to an input date
Various cleanups like "" and print removals