Commit fa3bdce4 authored by Laurent Bachelier's avatar Laurent Bachelier 🐧 Committed by ntome

phpbb: flake8 fixes, Python 3

parent 2b9613eb
......@@ -20,15 +20,14 @@
import re
from weboob.browser import LoginBrowser, need_login, URL
from weboob.exceptions import BrowserIncorrectPassword
from weboob.browser import URL, LoginBrowser, need_login
from weboob.capabilities.messages import CantSendMessage
from weboob.exceptions import BrowserIncorrectPassword
from .pages.forum import ForumPage, PostingPage, TopicPage
from .pages.index import LoginPage
from .pages.forum import ForumPage, TopicPage, PostingPage
from .tools import id2url, url2id
__all__ = ['PhpBB']
......@@ -56,7 +55,7 @@ class PhpBB(LoginBrowser):
data = {'login': 'Connexion',
'username': self.username,
'password': self.password,
}
}
self.location('ucp.php?mode=login', data=data)
if not self.page.logged:
......@@ -158,7 +157,7 @@ class PhpBB(LoginBrowser):
raise CantSendMessage('Please enter a title formatted like that:\n\t"[FORUM] SUBJECT"\n\n%s' % forums_prompt)
forum_id = None
for k,v in forums.iteritems():
for k, v in forums.items():
if v.lower() == m.group(1).lower():
forum_id = k
break
......
......@@ -18,15 +18,14 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from weboob.tools.backend import Module, BackendConfig
from weboob.tools.newsfeed import Newsfeed
from weboob.tools.value import Value, ValueInt, ValueBackendPassword
from weboob.capabilities.messages import CantSendMessage, CapMessages, CapMessagesPost, Message, Thread
from weboob.tools.backend import BackendConfig, Module
from weboob.tools.misc import limit
from weboob.capabilities.messages import CapMessages, CapMessagesPost, Message, Thread, CantSendMessage
from weboob.tools.newsfeed import Newsfeed
from weboob.tools.value import Value, ValueBackendPassword, ValueInt
from .browser import PhpBB
from .tools import rssid, url2id, id2url, id2topic
from .tools import id2topic, id2url, rssid, url2id
__all__ = ['PhpBBModule']
......@@ -42,7 +41,7 @@ class PhpBBModule(Module, CapMessages, CapMessagesPost):
Value('username', label='Username', default=''),
ValueBackendPassword('password', label='Password', default=''),
ValueInt('thread_unread_messages', label='Limit number of unread messages to retrieve for a thread', default=500)
)
)
STORAGE = {'seen': {}}
BROWSER = PhpBB
......
......@@ -29,7 +29,7 @@ from ..tools import parse_date
class Link(object):
(FORUM,
TOPIC) = xrange(2)
TOPIC) = range(2)
def __init__(self, type, url):
self.type = type
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment