Unused variables

This commit is contained in:
Jon Tibble 2012-03-12 22:12:16 +00:00
parent fd8af8691e
commit 6133e6a840
7 changed files with 13 additions and 15 deletions

View File

@ -166,7 +166,7 @@ class ImageManager(QtCore.QObject):
self.height = current_screen[u'size'].height()
# Mark the images as dirty for a rebuild by setting the image and byte
# stream to None.
for key, image in self._cache.iteritems():
for image in self._cache.values():
self._reset_image(image)
def update_images(self, image_type, background):
@ -176,7 +176,7 @@ class ImageManager(QtCore.QObject):
log.debug(u'update_images')
# Mark the images as dirty for a rebuild by setting the image and byte
# stream to None.
for key, image in self._cache.iteritems():
for image in self._cache.values():
if image.source == image_type:
image.background = background
self._reset_image(image)
@ -188,7 +188,7 @@ class ImageManager(QtCore.QObject):
log.debug(u'update_images')
# Mark the images as dirty for a rebuild by setting the image and byte
# stream to None.
for key, image in self._cache.iteritems():
for image in self._cache.values():
if image.source == image_type and image.name == name:
image.background = background
self._reset_image(image)

View File

@ -405,7 +405,7 @@ class PrintServiceForm(QtGui.QDialog, Ui_PrintServiceDialog):
# Only continue when we include the song's text.
if not self.slideTextCheckBox.isChecked():
return
for index, item in enumerate(self.serviceManager.serviceItems):
for item in self.serviceManager.serviceItems:
# Trigger Audit requests
Receiver.send_message(u'print_service_started',
[item[u'service_item']])

View File

@ -461,7 +461,7 @@ class ServiceManager(QtGui.QWidget):
log.debug(temp_file_name)
path_file_name = unicode(self.fileName())
path, file_name = os.path.split(path_file_name)
basename, extension = os.path.splitext(file_name)
basename = os.path.splitext(file_name)[0]
service_file_name = '%s.osd' % basename
log.debug(u'ServiceManager.saveFile - %s', path_file_name)
SettingsManager.set_last_dir(
@ -1359,15 +1359,15 @@ class ServiceManager(QtGui.QWidget):
Handle of the event pint passed
"""
link = event.mimeData()
if event.mimeData().hasUrls():
if link.hasUrls():
event.setDropAction(QtCore.Qt.CopyAction)
event.accept()
for url in event.mimeData().urls():
for url in link.urls():
filename = unicode(url.toLocalFile())
if filename.endswith(u'.osz'):
self.onLoadServiceClicked(filename)
elif event.mimeData().hasText():
plugin = unicode(event.mimeData().text())
elif link.hasText():
plugin = unicode(link.text())
item = self.serviceManagerList.itemAt(event.pos())
# ServiceManager started the drag and drop
if plugin == u'ServiceManager':

View File

@ -57,7 +57,7 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
def exec_(self):
# load all the settings
self.settingListWidget.clear()
for tabIndex in range(0, self.stackedLayout.count() + 1):
while self.stackedLayout.count():
# take at 0 and the rest shuffle up.
self.stackedLayout.takeAt(0)
self.insertTab(self.generalTab, 0, PluginStatus.Active)

View File

@ -153,7 +153,6 @@ class ThemeManager(QtGui.QWidget):
Import new themes downloaded by the first time wizard
"""
Receiver.send_message(u'cursor_busy')
encoding = get_filesystem_encoding()
files = SettingsManager.get_files(self.settingsSection, u'.otz')
for file in files:
file = os.path.join(self.path, file)

View File

@ -189,7 +189,7 @@ class ImageMediaItem(MediaManagerItem):
# Continue with the existing images.
for bitem in items:
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
(path, name) = os.path.split(filename)
name = os.path.split(filename)[1]
service_item.add_from_image(filename, name, background)
return True
@ -220,7 +220,7 @@ class ImageMediaItem(MediaManagerItem):
bitem = self.listView.item(item.row())
filename = unicode(bitem.data(QtCore.Qt.UserRole).toString())
if os.path.exists(filename):
(path, name) = os.path.split(filename)
name = os.path.split(filename)[1]
if self.plugin.liveController.display.directImage(name,
filename, background):
self.resetAction.setVisible(True)

View File

@ -589,7 +589,7 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
verse_names.append(u'%s%s' % (
VerseType.translated_tag(verse[0]), verse[1:]))
verses_not_used = []
for count, verse in enumerate(verses):
for verse in verses:
if not verse in order:
verses_not_used.append(verse)
self.warningLabel.setVisible(len(verses_not_used) > 0)
@ -680,7 +680,6 @@ class EditSongForm(QtGui.QDialog, Ui_EditSongDialog):
self.verseListWidget.rowCount())
if not result:
return False
item = int(self.songBookComboBox.currentIndex())
text = unicode(self.songBookComboBox.currentText())
if self.songBookComboBox.findText(text, QtCore.Qt.MatchExactly) < 0:
if QtGui.QMessageBox.question(self,