Easy spacing fixes, trailing stuff
Remove useless trailing \ Remove trailing spaces Add missing empty lines autopep8 -ir -j2 --select=E301,E302,E502,W291,W293,W391 . Diff quickly checked.
This commit is contained in:
parent
c21d1f7925
commit
7094931c92
231 changed files with 474 additions and 67 deletions
|
|
@ -47,6 +47,7 @@ class Task(object):
|
|||
def __repr__(self):
|
||||
return '<Task (%s,%s)>' % (self.backend, self.capability)
|
||||
|
||||
|
||||
class Member(object):
|
||||
def __init__(self, id, name):
|
||||
self.name = name
|
||||
|
|
@ -63,6 +64,7 @@ class Member(object):
|
|||
name = '%s..' % name[:18]
|
||||
return name
|
||||
|
||||
|
||||
class Event(object):
|
||||
def __init__(self, name, backend):
|
||||
self.my_id = backend.browser.get_userid()
|
||||
|
|
@ -272,6 +274,7 @@ h2. Attendees
|
|||
self.content.content = s
|
||||
self.backend.push_content(self.content, message)
|
||||
|
||||
|
||||
class Boobathon(ReplApplication):
|
||||
APPNAME = 'boobathon'
|
||||
VERSION = '0.f'
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class Boobill(ReplApplication):
|
|||
Get the list of bills documents for subscriptions.
|
||||
If no ID given, display bills of all backends
|
||||
"""
|
||||
self.exec_method(id, 'iter_bills')
|
||||
self.exec_method(id, 'iter_bills')
|
||||
|
||||
def do_download(self, line):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ __all__ = ['Cineoob']
|
|||
ROLE_LIST = ['actor','director','writer','composer','producer']
|
||||
COUNTRY_LIST = ['us','fr','de','jp']
|
||||
|
||||
|
||||
class MovieInfoFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'original_title', 'release_date', 'other_titles', 'duration', 'pitch', 'note', 'roles', 'country')
|
||||
|
||||
|
|
@ -100,6 +101,7 @@ def yearsago(years, from_date=None):
|
|||
return from_date.replace(month=2, day=28,
|
||||
year=from_date.year-years)
|
||||
|
||||
|
||||
def num_years(begin, end=None):
|
||||
if end is None:
|
||||
end = datetime.now()
|
||||
|
|
@ -109,6 +111,7 @@ def num_years(begin, end=None):
|
|||
else:
|
||||
return num_years
|
||||
|
||||
|
||||
class PersonInfoFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'name', 'birth_date', 'birth_place', 'short_biography')
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ class FakeConic(object):
|
|||
STATUS_CONNECTED = None
|
||||
STATUS_DISCONNECTED = None
|
||||
CONNECT_FLAG_NONE = None
|
||||
|
||||
def Connection(self):
|
||||
raise NotImplementedError()
|
||||
try:
|
||||
|
|
@ -50,6 +51,7 @@ from logging import debug
|
|||
|
||||
__all__ = ['Masstransit']
|
||||
|
||||
|
||||
class MasstransitHildon():
|
||||
"hildon interface"
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ from weboob.capabilities.messages import ICapMessages
|
|||
from .ui.main_window_ui import Ui_MainWindow
|
||||
from .messages_manager import MessagesManager
|
||||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, weboob, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ from weboob.tools.misc import to_unicode
|
|||
|
||||
from .ui.messages_manager_ui import Ui_MessagesManager
|
||||
|
||||
|
||||
class MessagesManager(QWidget):
|
||||
def __init__(self, weboob, parent=None):
|
||||
QWidget.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ from .person import Person
|
|||
from .torrent import Torrent
|
||||
from .subtitle import Subtitle
|
||||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, weboob, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ from PyQt4.QtCore import Qt
|
|||
from weboob.applications.qcineoob.ui.minimovie_ui import Ui_MiniMovie
|
||||
from weboob.capabilities.base import empty
|
||||
|
||||
|
||||
class MiniMovie(QFrame):
|
||||
def __init__(self, weboob, backend, movie, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ from PyQt4.QtCore import Qt
|
|||
from weboob.applications.qcineoob.ui.miniperson_ui import Ui_MiniPerson
|
||||
from weboob.capabilities.base import empty
|
||||
|
||||
|
||||
class MiniPerson(QFrame):
|
||||
def __init__(self, weboob, backend, person, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ from PyQt4.QtGui import QFrame
|
|||
from weboob.applications.qcineoob.ui.minisubtitle_ui import Ui_MiniSubtitle
|
||||
from weboob.capabilities.base import empty
|
||||
|
||||
|
||||
class MiniSubtitle(QFrame):
|
||||
def __init__(self, weboob, backend, subtitle, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ from weboob.applications.qcineoob.ui.minitorrent_ui import Ui_MiniTorrent
|
|||
from weboob.applications.weboorrents.weboorrents import sizeof_fmt
|
||||
from weboob.capabilities.base import empty
|
||||
|
||||
|
||||
class MiniTorrent(QFrame):
|
||||
def __init__(self, weboob, backend, torrent, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ from weboob.capabilities.base import empty
|
|||
from weboob.applications.suboob.suboob import LANGUAGE_CONV
|
||||
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||
|
||||
|
||||
class Movie(QFrame):
|
||||
def __init__(self, movie, backend, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ from weboob.applications.qcineoob.ui.person_ui import Ui_Person
|
|||
from weboob.capabilities.base import empty
|
||||
from weboob.applications.cineoob.cineoob import ROLE_LIST
|
||||
|
||||
|
||||
class Person(QFrame):
|
||||
def __init__(self, person, backend, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class QCineoob(QtApplication):
|
|||
CONFIG = {'settings': {'backend': '',
|
||||
}
|
||||
}
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends([ICapCinema,ICapTorrent,ICapSubtitle])
|
||||
self.load_config()
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ from PyQt4.QtGui import QFrame, QFileDialog
|
|||
from weboob.applications.qcineoob.ui.subtitle_ui import Ui_Subtitle
|
||||
from weboob.capabilities.base import empty
|
||||
|
||||
|
||||
class Subtitle(QFrame):
|
||||
def __init__(self, subtitle, backend, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
@ -77,4 +78,3 @@ class Subtitle(QFrame):
|
|||
print >>sys.stderr, 'Unable to write subtitle file in "%s": %s' % (dest, e)
|
||||
return 1
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ from weboob.applications.qcineoob.ui.torrent_ui import Ui_Torrent
|
|||
from weboob.applications.weboorrents.weboorrents import sizeof_fmt
|
||||
from weboob.capabilities.base import empty
|
||||
|
||||
|
||||
class Torrent(QFrame):
|
||||
def __init__(self, torrent, backend, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
@ -77,4 +78,3 @@ class Torrent(QFrame):
|
|||
print >>sys.stderr, 'Unable to write .torrent in "%s": %s' % (dest, e)
|
||||
return 1
|
||||
return
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ from weboob.capabilities.base import NotLoaded, NotAvailable
|
|||
from .ui.main_window_ui import Ui_MainWindow
|
||||
from .query import QueryDialog
|
||||
|
||||
|
||||
class HousingListWidgetItem(QListWidgetItem):
|
||||
def __init__(self, housing, *args, **kwargs):
|
||||
QListWidgetItem.__init__(self, *args, **kwargs)
|
||||
|
|
@ -56,6 +57,7 @@ class HousingListWidgetItem(QListWidgetItem):
|
|||
elif self.background().color() != QColor(0,0,0):
|
||||
self.setBackground(QBrush())
|
||||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, storage, weboob, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from weboob.tools.application.qt import QtDo, HTMLDelegate
|
|||
|
||||
from .ui.query_ui import Ui_QueryDialog
|
||||
|
||||
|
||||
class QueryDialog(QDialog):
|
||||
def __init__(self, weboob, parent=None):
|
||||
QDialog.__init__(self, parent)
|
||||
|
|
@ -43,7 +44,7 @@ class QueryDialog(QDialog):
|
|||
|
||||
if hasattr(self.ui.cityEdit, "setPlaceholderText"):
|
||||
self.ui.cityEdit.setPlaceholderText("Press enter to search city")
|
||||
|
||||
|
||||
def keyPressEvent(self, event):
|
||||
"""
|
||||
Disable handler <Enter> and <Escape> to prevent closing the window.
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ from .ui.thread_message_ui import Ui_ThreadMessage
|
|||
from .ui.profile_ui import Ui_Profile
|
||||
from .ui.notes_ui import Ui_Notes
|
||||
|
||||
|
||||
class ThreadMessage(QFrame):
|
||||
"""
|
||||
This class represents a message in the thread tab.
|
||||
|
|
@ -70,6 +71,7 @@ class ThreadMessage(QFrame):
|
|||
return False
|
||||
return self.message == m.message
|
||||
|
||||
|
||||
class ContactThread(QWidget):
|
||||
"""
|
||||
The thread of the selected contact.
|
||||
|
|
@ -341,6 +343,7 @@ class ContactProfile(QWidget):
|
|||
text += '<br /><font color=#ff0000><i>(Hidden photo)</i></font>'
|
||||
self.ui.photoUrlLabel.setText(text)
|
||||
|
||||
|
||||
class ContactNotes(QWidget):
|
||||
""" Widget for storing notes about a contact """
|
||||
|
||||
|
|
@ -399,6 +402,7 @@ class ContactNotes(QWidget):
|
|||
QMessageBox.critical(self, self.tr('Error while saving notes'),
|
||||
content, QMessageBox.Ok)
|
||||
|
||||
|
||||
class IGroup(object):
|
||||
def __init__(self, weboob, id, name):
|
||||
self.id = id
|
||||
|
|
@ -408,6 +412,7 @@ class IGroup(object):
|
|||
def iter_contacts(self, cb):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class MetaGroup(IGroup):
|
||||
def iter_contacts(self, cb):
|
||||
if self.id == 'online':
|
||||
|
|
@ -427,6 +432,7 @@ class MetaGroup(IGroup):
|
|||
self.process = None
|
||||
cb(None)
|
||||
|
||||
|
||||
class ContactsWidget(QWidget):
|
||||
def __init__(self, weboob, parent=None):
|
||||
QWidget.__init__(self, parent)
|
||||
|
|
@ -587,5 +593,3 @@ class ContactsWidget(QWidget):
|
|||
content += u'\n%s\n' % to_unicode(backtrace)
|
||||
QMessageBox.critical(self, self.tr('Error while getting contact'),
|
||||
content, QMessageBox.Ok)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ from weboob.tools.application.qt import QtDo, HTMLDelegate
|
|||
|
||||
from .ui.events_ui import Ui_Events
|
||||
|
||||
|
||||
class EventsWidget(QWidget):
|
||||
def __init__(self, weboob, parent=None):
|
||||
QWidget.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ from .status import AccountsStatus
|
|||
from .contacts import ContactsWidget
|
||||
from .events import EventsWidget
|
||||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, weboob, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ from weboob.tools.application.qt import QtApplication
|
|||
|
||||
from .main_window import MainWindow
|
||||
|
||||
|
||||
class QHaveDate(QtApplication):
|
||||
APPNAME = 'qhavedate'
|
||||
VERSION = '0.f'
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from weboob.capabilities.account import ICapAccount, StatusField
|
|||
from weboob.tools.application.qt import QtDo
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
||||
|
||||
class Account(QFrame):
|
||||
def __init__(self, weboob, backend, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
@ -103,6 +104,7 @@ class Account(QFrame):
|
|||
self.body.setText(u'<b>Unable to connect:</b> %s' % to_unicode(err))
|
||||
self.title.setText(u'<font color=#ff0000>%s</font>' % unicode(self.title.text()))
|
||||
|
||||
|
||||
class AccountsStatus(QScrollArea):
|
||||
def __init__(self, weboob, parent=None):
|
||||
QScrollArea.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ from weboob.applications.qvideoob.ui.main_window_ui import Ui_MainWindow
|
|||
from .video import Video
|
||||
from .minivideo import MiniVideo
|
||||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, weboob, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from weboob.tools.application.qt import QtDo
|
|||
from weboob.applications.qvideoob.ui.minivideo_ui import Ui_MiniVideo
|
||||
from .video import Video
|
||||
|
||||
|
||||
class MiniVideo(QFrame):
|
||||
def __init__(self, weboob, backend, video, parent=None):
|
||||
QFrame.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ class QVideoob(QtApplication):
|
|||
'backend': ''
|
||||
}
|
||||
}
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapVideo)
|
||||
self.load_config()
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ from PyQt4.phonon import Phonon
|
|||
|
||||
from weboob.applications.qvideoob.ui.video_ui import Ui_Video
|
||||
|
||||
|
||||
class Video(QDialog):
|
||||
def __init__(self, video, parent=None):
|
||||
QDialog.__init__(self, parent)
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ from weboob.tools.misc import to_unicode
|
|||
|
||||
from .ui.main_window_ui import Ui_MainWindow
|
||||
|
||||
|
||||
class MainWindow(QtMainWindow):
|
||||
def __init__(self, config, weboob, parent=None):
|
||||
QtMainWindow.__init__(self, parent)
|
||||
|
|
@ -102,11 +103,11 @@ class MainWindow(QtMainWindow):
|
|||
_id = unicode(self.ui.idEdit.text())
|
||||
if not _id:
|
||||
return
|
||||
|
||||
|
||||
self.ui.loadButton.setEnabled(False)
|
||||
self.ui.loadButton.setText('Loading...')
|
||||
self.ui.contentEdit.setReadOnly(True)
|
||||
|
||||
|
||||
backend = str(self.ui.backendBox.currentText())
|
||||
self.process = QtDo(self.weboob,
|
||||
self._loadedPage,
|
||||
|
|
@ -137,7 +138,7 @@ class MainWindow(QtMainWindow):
|
|||
self.ui.contentEdit.setPlainText(self.content.content)
|
||||
self.setWindowTitle("QWebcontentedit - %s@%s" %(self.content.id,
|
||||
backend.name))
|
||||
self.backend = backend
|
||||
self.backend = backend
|
||||
|
||||
def _errorLoadPage(self, backend, error, backtrace):
|
||||
""" Error callback for loadPage """
|
||||
|
|
@ -203,7 +204,7 @@ class MainWindow(QtMainWindow):
|
|||
|
||||
self.ui.loadHistoryButton.setEnabled(False)
|
||||
self.ui.loadHistoryButton.setText("Loading...")
|
||||
|
||||
|
||||
self.ui.historyTable.clear()
|
||||
self.ui.historyTable.setRowCount(0)
|
||||
|
||||
|
|
@ -212,7 +213,7 @@ class MainWindow(QtMainWindow):
|
|||
"Author",
|
||||
"Summary"])
|
||||
self.ui.historyTable.setColumnWidth(3, 1000)
|
||||
|
||||
|
||||
self.process = QtDo(self.weboob,
|
||||
self._gotRevision,
|
||||
self._errorHistory)
|
||||
|
|
@ -234,13 +235,13 @@ class MainWindow(QtMainWindow):
|
|||
# are not modifiable (they are modifiable by default)
|
||||
item_revision = QTableWidgetItem(revision.id)
|
||||
item_revision.setFlags(Qt.ItemIsEnabled)
|
||||
|
||||
|
||||
item_time = QTableWidgetItem(revision.timestamp.strftime('%Y-%m-%d %H:%M:%S'))
|
||||
item_time.setFlags(Qt.ItemIsEnabled)
|
||||
|
||||
|
||||
item_author = QTableWidgetItem(revision.author)
|
||||
item_author.setFlags(Qt.ItemIsEnabled)
|
||||
|
||||
|
||||
item_summary = QTableWidgetItem(revision.comment)
|
||||
item_summary.setFlags(Qt.ItemIsEnabled)
|
||||
|
||||
|
|
@ -260,6 +261,6 @@ class MainWindow(QtMainWindow):
|
|||
content += '\n%s\n' % to_unicode(backtrace)
|
||||
QMessageBox.critical(self, self.tr('Error while loading history'),
|
||||
content, QMessageBox.Ok)
|
||||
|
||||
|
||||
self.ui.loadHistoryButton.setEnabled(True)
|
||||
self.ui.loadHistoryButton.setText("Reload")
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ class VideoListFormatter(PrettyFormatter):
|
|||
result += u' (%s/%s)' % (obj.rating, obj.rating_max)
|
||||
return result
|
||||
|
||||
|
||||
class Videoob(ReplApplication):
|
||||
APPNAME = 'videoob'
|
||||
VERSION = '0.f'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue