rename ICap to Cap (closes #1424)
This commit is contained in:
parent
51958135cb
commit
e025fb0b20
244 changed files with 679 additions and 679 deletions
|
|
@ -26,7 +26,7 @@ from decimal import Decimal, InvalidOperation
|
|||
import sys
|
||||
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.capabilities.bank import ICapBank, Account, Transaction
|
||||
from weboob.capabilities.bank import CapBank, Account, Transaction
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ class Boobank(ReplApplication):
|
|||
APPNAME = 'boobank'
|
||||
VERSION = '0.j'
|
||||
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon, Christophe Benz'
|
||||
CAPS = ICapBank
|
||||
CAPS = CapBank
|
||||
DESCRIPTION = "Console application allowing to list your bank accounts and get their balance, " \
|
||||
"display accounts history and coming bank operations, and transfer money from an account to " \
|
||||
"another (if available)."
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import sys
|
|||
from urlparse import urlsplit
|
||||
from random import choice
|
||||
|
||||
from weboob.capabilities.content import ICapContent
|
||||
from weboob.capabilities.content import CapContent
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.ordereddict import OrderedDict
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ class Boobathon(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2011 Romain Bignon'
|
||||
DESCRIPTION = 'Console application to participate to a Boobathon.'
|
||||
SHORT_DESCRIPTION = "participate in a Boobathon"
|
||||
CAPS = ICapContent
|
||||
CAPS = CapContent
|
||||
SYNOPSIS = 'Usage: %prog [-dqv] [-b backends] [-cnfs] boobathon\n'
|
||||
SYNOPSIS += ' %prog [--help] [--version]'
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from datetime import time, datetime
|
|||
from weboob.tools.date import parse_date
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.capabilities.calendar import ICapCalendarEvent, Query, CATEGORIES, BaseCalendarEvent
|
||||
from weboob.capabilities.calendar import CapCalendarEvent, Query, CATEGORIES, BaseCalendarEvent
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ class Boobcoming(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2012 Bezleputh'
|
||||
DESCRIPTION = "Console application to see upcoming events."
|
||||
SHORT_DESCRIPTION = "see upcoming events"
|
||||
CAPS = ICapCalendarEvent
|
||||
CAPS = CapCalendarEvent
|
||||
EXTRA_FORMATTERS = {'upcoming_list': UpcomingListFormatter,
|
||||
'upcoming': UpcomingFormatter,
|
||||
'simple_upcoming': UpcomingSimpleFormatter,
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
import sys
|
||||
from decimal import Decimal
|
||||
|
||||
from weboob.capabilities.bill import ICapBill, Detail, Subscription
|
||||
from weboob.capabilities.bill import CapBill, Detail, Subscription
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import PrettyFormatter
|
||||
from weboob.tools.application.base import MoreResultsAvailable
|
||||
|
|
@ -45,7 +45,7 @@ class Boobill(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2012 Florent Fourcot'
|
||||
DESCRIPTION = 'Console application allowing to get and download bills.'
|
||||
SHORT_DESCRIPTION = "get and download bills"
|
||||
CAPS = ICapBill
|
||||
CAPS = CapBill
|
||||
COLLECTION_OBJECTS = (Subscription, )
|
||||
EXTRA_FORMATTERS = {'subscriptions': SubscriptionsFormatter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.lyrics import ICapLyrics
|
||||
from weboob.capabilities.lyrics import CapLyrics
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
|
@ -62,7 +62,7 @@ class Booblyrics(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2013 Julien Veyssier'
|
||||
DESCRIPTION = "Console application allowing to search for song lyrics on various websites."
|
||||
SHORT_DESCRIPTION = "search and display song lyrics"
|
||||
CAPS = ICapLyrics
|
||||
CAPS = CapLyrics
|
||||
EXTRA_FORMATTERS = {'lyrics_list': LyricsListFormatter,
|
||||
'lyrics_get': LyricsGetFormatter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,9 @@ from tempfile import NamedTemporaryFile
|
|||
from lxml import etree
|
||||
|
||||
from weboob.core import CallErrors
|
||||
from weboob.capabilities.messages import ICapMessages, Message, Thread
|
||||
from weboob.capabilities.account import ICapAccount
|
||||
from weboob.capabilities.contact import ICapContact
|
||||
from weboob.capabilities.messages import CapMessages, Message, Thread
|
||||
from weboob.capabilities.account import CapAccount
|
||||
from weboob.capabilities.contact import CapContact
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter
|
||||
from weboob.tools.misc import html2text
|
||||
|
|
@ -239,7 +239,7 @@ class Boobmsg(ReplApplication):
|
|||
DESCRIPTION = "Console application allowing to send messages on various websites and " \
|
||||
"to display message threads and contents."
|
||||
SHORT_DESCRIPTION = "send and receive message threads"
|
||||
CAPS = ICapMessages
|
||||
CAPS = CapMessages
|
||||
EXTRA_FORMATTERS = {'msglist': MessagesListFormatter,
|
||||
'msg': MessageFormatter,
|
||||
'xhtml': XHtmlFormatter,
|
||||
|
|
@ -262,7 +262,7 @@ class Boobmsg(ReplApplication):
|
|||
type='string', dest='title')
|
||||
|
||||
def load_default_backends(self):
|
||||
self.load_backends(ICapMessages, storage=self.create_storage())
|
||||
self.load_backends(CapMessages, storage=self.create_storage())
|
||||
|
||||
def main(self, argv):
|
||||
self.load_config()
|
||||
|
|
@ -282,7 +282,7 @@ class Boobmsg(ReplApplication):
|
|||
results = {}
|
||||
for backend, field in self.do('get_account_status',
|
||||
backends=backend_name,
|
||||
caps=ICapAccount):
|
||||
caps=CapAccount):
|
||||
if backend.name in results:
|
||||
results[backend.name].append(field)
|
||||
else:
|
||||
|
|
@ -460,7 +460,7 @@ class Boobmsg(ReplApplication):
|
|||
_id, backend_name = self.parse_id(id, unique_backend=True)
|
||||
|
||||
found = 0
|
||||
for backend, contact in self.do('get_contact', _id, backends=backend_name, caps=ICapContact):
|
||||
for backend, contact in self.do('get_contact', _id, backends=backend_name, caps=CapContact):
|
||||
if contact:
|
||||
self.format(contact)
|
||||
found = 1
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from weboob.capabilities.library import ICapBook, Book
|
||||
from weboob.capabilities.library import CapBook, Book
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.application.formatters.iformatter import PrettyFormatter
|
||||
import sys
|
||||
|
|
@ -41,7 +41,7 @@ class Boobooks(ReplApplication):
|
|||
APPNAME = 'boobooks'
|
||||
VERSION = '0.j'
|
||||
COPYRIGHT = 'Copyright(C) 2012 Jeremy Monnet'
|
||||
CAPS = ICapBook
|
||||
CAPS = CapBook
|
||||
DESCRIPTION = "Console application allowing to list your books rented or booked at the library, " \
|
||||
"book and search new ones, get your booking history (if available)."
|
||||
SHORT_DESCRIPTION = "manage rented books"
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.capabilities.gauge import ICapGauge, SensorNotFound
|
||||
from weboob.capabilities.gauge import CapGauge, SensorNotFound
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ class Boobsize(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2013 Florent Fourcot'
|
||||
DESCRIPTION = "Console application allowing to display various sensors and gauges values."
|
||||
SHORT_DESCRIPTION = "display sensors and gauges values"
|
||||
CAPS = (ICapGauge)
|
||||
CAPS = (CapGauge)
|
||||
DEFAULT_FORMATTER = 'table'
|
||||
EXTRA_FORMATTERS = {'gauge_list': GaugeFormatter, }
|
||||
COMMANDS_FORMATTERS = {'search': 'gauge_list',
|
||||
|
|
@ -123,7 +123,7 @@ class Boobsize(ReplApplication):
|
|||
"""
|
||||
self.change_path([u'gauges'])
|
||||
self.start_format()
|
||||
for backend, gauge in self.do('iter_gauges', pattern or None, caps=ICapGauge):
|
||||
for backend, gauge in self.do('iter_gauges', pattern or None, caps=CapGauge):
|
||||
self.cached_format(gauge)
|
||||
|
||||
def complete_search(self, text, line, *ignored):
|
||||
|
|
@ -141,7 +141,7 @@ class Boobsize(ReplApplication):
|
|||
_id, backend_name = self.parse_id(gauge)
|
||||
|
||||
self.start_format()
|
||||
for backend, sensor in self.do('iter_sensors', _id, pattern=pattern, backends=backend_name, caps=ICapGauge):
|
||||
for backend, sensor in self.do('iter_sensors', _id, pattern=pattern, backends=backend_name, caps=CapGauge):
|
||||
self.format(sensor)
|
||||
|
||||
def do_history(self, line):
|
||||
|
|
@ -154,7 +154,7 @@ class Boobsize(ReplApplication):
|
|||
_id, backend_name = self.parse_id(gauge)
|
||||
|
||||
self.start_format()
|
||||
for backend, measure in self.do('iter_gauge_history', _id, backends=backend_name, caps=ICapGauge):
|
||||
for backend, measure in self.do('iter_gauge_history', _id, backends=backend_name, caps=CapGauge):
|
||||
self.format(measure)
|
||||
|
||||
def complete_last_sensor_measure(self, text, line, *ignored):
|
||||
|
|
@ -172,5 +172,5 @@ class Boobsize(ReplApplication):
|
|||
_id, backend_name = self.parse_id(gauge)
|
||||
|
||||
self.start_format()
|
||||
for backend, measure in self.do('get_last_measure', _id, backends=backend_name, caps=ICapGauge):
|
||||
for backend, measure in self.do('get_last_measure', _id, backends=backend_name, caps=CapGauge):
|
||||
self.format(measure)
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ import re
|
|||
import unicodedata
|
||||
|
||||
from weboob.capabilities.base import empty, BaseObject
|
||||
from weboob.capabilities.bugtracker import ICapBugTracker, Query, Update, Project, Issue, IssueError
|
||||
from weboob.capabilities.bugtracker import CapBugTracker, Query, Update, Project, Issue, IssueError
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
from weboob.tools.misc import html2text
|
||||
|
|
@ -109,7 +109,7 @@ class BoobTracker(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2011 Romain Bignon'
|
||||
DESCRIPTION = "Console application allowing to create, edit, view bug tracking issues."
|
||||
SHORT_DESCRIPTION = "manage bug tracking issues"
|
||||
CAPS = ICapBugTracker
|
||||
CAPS = CapBugTracker
|
||||
EXTRA_FORMATTERS = {'issue_info': IssueFormatter,
|
||||
'issues_list': IssuesListFormatter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,9 +24,9 @@ from datetime import datetime
|
|||
|
||||
from weboob.applications.weboorrents.weboorrents import TorrentInfoFormatter, TorrentListFormatter
|
||||
from weboob.applications.suboob.suboob import SubtitleInfoFormatter, SubtitleListFormatter
|
||||
from weboob.capabilities.torrent import ICapTorrent, MagnetOnly
|
||||
from weboob.capabilities.cinema import ICapCinema
|
||||
from weboob.capabilities.subtitle import ICapSubtitle
|
||||
from weboob.capabilities.torrent import CapTorrent, MagnetOnly
|
||||
from weboob.capabilities.cinema import CapCinema
|
||||
from weboob.capabilities.subtitle import CapSubtitle
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
|
@ -183,7 +183,7 @@ class Cineoob(ReplApplication):
|
|||
", list persons related to a movie, list movies related to a person and list common movies " \
|
||||
"of two persons."
|
||||
SHORT_DESCRIPTION = "search movies and persons around cinema"
|
||||
CAPS = (ICapCinema, ICapTorrent, ICapSubtitle)
|
||||
CAPS = (CapCinema, CapTorrent, CapSubtitle)
|
||||
EXTRA_FORMATTERS = {'movie_list': MovieListFormatter,
|
||||
'movie_info': MovieInfoFormatter,
|
||||
'movie_releases': MovieReleasesFormatter,
|
||||
|
|
@ -229,11 +229,11 @@ class Cineoob(ReplApplication):
|
|||
"""
|
||||
id1, id2 = self.parse_command_args(line, 2, 1)
|
||||
|
||||
person1 = self.get_object(id1, 'get_person', caps=ICapCinema)
|
||||
person1 = self.get_object(id1, 'get_person', caps=CapCinema)
|
||||
if not person1:
|
||||
print >>sys.stderr, 'Person not found: %s' % id1
|
||||
return 3
|
||||
person2 = self.get_object(id2, 'get_person', caps=ICapCinema)
|
||||
person2 = self.get_object(id2, 'get_person', caps=CapCinema)
|
||||
if not person2:
|
||||
print >>sys.stderr, 'Person not found: %s' % id2
|
||||
return 3
|
||||
|
|
@ -242,15 +242,15 @@ class Cineoob(ReplApplication):
|
|||
self.options.count = None
|
||||
|
||||
lid1 = []
|
||||
for backend, id in self.do('iter_person_movies_ids', person1.id, caps=ICapCinema):
|
||||
for backend, id in self.do('iter_person_movies_ids', person1.id, caps=CapCinema):
|
||||
lid1.append(id)
|
||||
lid2 = []
|
||||
for backend, id in self.do('iter_person_movies_ids', person2.id, caps=ICapCinema):
|
||||
for backend, id in self.do('iter_person_movies_ids', person2.id, caps=CapCinema):
|
||||
lid2.append(id)
|
||||
self.options.count = initial_count
|
||||
inter = list(set(lid1) & set(lid2))
|
||||
for common in inter:
|
||||
movie = self.get_object(common, 'get_movie', caps=ICapCinema)
|
||||
movie = self.get_object(common, 'get_movie', caps=CapCinema)
|
||||
if movie:
|
||||
self.cached_format(movie)
|
||||
|
||||
|
|
@ -262,11 +262,11 @@ class Cineoob(ReplApplication):
|
|||
"""
|
||||
id1, id2 = self.parse_command_args(line, 2, 1)
|
||||
|
||||
movie1 = self.get_object(id1, 'get_movie', caps=ICapCinema)
|
||||
movie1 = self.get_object(id1, 'get_movie', caps=CapCinema)
|
||||
if not movie1:
|
||||
print >>sys.stderr, 'Movie not found: %s' % id1
|
||||
return 3
|
||||
movie2 = self.get_object(id2, 'get_movie', caps=ICapCinema)
|
||||
movie2 = self.get_object(id2, 'get_movie', caps=CapCinema)
|
||||
if not movie2:
|
||||
print >>sys.stderr, 'Movie not found: %s' % id2
|
||||
return 3
|
||||
|
|
@ -275,15 +275,15 @@ class Cineoob(ReplApplication):
|
|||
self.options.count = None
|
||||
|
||||
lid1 = []
|
||||
for backend, id in self.do('iter_movie_persons_ids', movie1.id, caps=ICapCinema):
|
||||
for backend, id in self.do('iter_movie_persons_ids', movie1.id, caps=CapCinema):
|
||||
lid1.append(id)
|
||||
lid2 = []
|
||||
for backend, id in self.do('iter_movie_persons_ids', movie2.id, caps=ICapCinema):
|
||||
for backend, id in self.do('iter_movie_persons_ids', movie2.id, caps=CapCinema):
|
||||
lid2.append(id)
|
||||
self.options.count = initial_count
|
||||
inter = list(set(lid1) & set(lid2))
|
||||
for common in inter:
|
||||
person = self.get_object(common, 'get_person', caps=ICapCinema)
|
||||
person = self.get_object(common, 'get_person', caps=CapCinema)
|
||||
self.cached_format(person)
|
||||
|
||||
def do_info_movie(self, id):
|
||||
|
|
@ -292,7 +292,7 @@ class Cineoob(ReplApplication):
|
|||
|
||||
Get information about a movie.
|
||||
"""
|
||||
movie = self.get_object(id, 'get_movie', caps=ICapCinema)
|
||||
movie = self.get_object(id, 'get_movie', caps=CapCinema)
|
||||
|
||||
if not movie:
|
||||
print >>sys.stderr, 'Movie not found: %s' % id
|
||||
|
|
@ -307,7 +307,7 @@ class Cineoob(ReplApplication):
|
|||
|
||||
Get information about a person.
|
||||
"""
|
||||
person = self.get_object(id, 'get_person', caps=ICapCinema)
|
||||
person = self.get_object(id, 'get_person', caps=CapCinema)
|
||||
|
||||
if not person:
|
||||
print >>sys.stderr, 'Person not found: %s' % id
|
||||
|
|
@ -328,7 +328,7 @@ class Cineoob(ReplApplication):
|
|||
pattern = None
|
||||
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, movie in self.do('iter_movies', pattern=pattern, caps=ICapCinema):
|
||||
for backend, movie in self.do('iter_movies', pattern=pattern, caps=CapCinema):
|
||||
self.cached_format(movie)
|
||||
|
||||
@defaultcount(10)
|
||||
|
|
@ -343,7 +343,7 @@ class Cineoob(ReplApplication):
|
|||
pattern = None
|
||||
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, person in self.do('iter_persons', pattern=pattern, caps=ICapCinema):
|
||||
for backend, person in self.do('iter_persons', pattern=pattern, caps=CapCinema):
|
||||
self.cached_format(person)
|
||||
|
||||
def do_casting(self, line):
|
||||
|
|
@ -355,12 +355,12 @@ class Cineoob(ReplApplication):
|
|||
"""
|
||||
movie_id, role = self.parse_command_args(line, 2, 1)
|
||||
|
||||
movie = self.get_object(movie_id, 'get_movie', caps=ICapCinema)
|
||||
movie = self.get_object(movie_id, 'get_movie', caps=CapCinema)
|
||||
if not movie:
|
||||
print >>sys.stderr, 'Movie not found: %s' % id
|
||||
return 3
|
||||
|
||||
for backend, person in self.do('iter_movie_persons', movie.id, role, backends=movie.backend, caps=ICapCinema):
|
||||
for backend, person in self.do('iter_movie_persons', movie.id, role, backends=movie.backend, caps=CapCinema):
|
||||
self.cached_format(person)
|
||||
|
||||
def do_filmography(self, line):
|
||||
|
|
@ -372,12 +372,12 @@ class Cineoob(ReplApplication):
|
|||
"""
|
||||
person_id, role = self.parse_command_args(line, 2, 1)
|
||||
|
||||
person = self.get_object(person_id, 'get_person', caps=ICapCinema)
|
||||
person = self.get_object(person_id, 'get_person', caps=CapCinema)
|
||||
if not person:
|
||||
print >>sys.stderr, 'Person not found: %s' % id
|
||||
return 3
|
||||
|
||||
for backend, movie in self.do('iter_person_movies', person.id, role, backends=person.backend, caps=ICapCinema):
|
||||
for backend, movie in self.do('iter_person_movies', person.id, role, backends=person.backend, caps=CapCinema):
|
||||
self.cached_format(movie)
|
||||
|
||||
def do_biography(self, person_id):
|
||||
|
|
@ -386,7 +386,7 @@ class Cineoob(ReplApplication):
|
|||
|
||||
Show the complete biography of a person.
|
||||
"""
|
||||
person = self.get_object(person_id, 'get_person', ('name', 'biography'), caps=ICapCinema)
|
||||
person = self.get_object(person_id, 'get_person', ('name', 'biography'), caps=CapCinema)
|
||||
if not person:
|
||||
print >>sys.stderr, 'Person not found: %s' % person_id
|
||||
return 3
|
||||
|
|
@ -410,13 +410,13 @@ class Cineoob(ReplApplication):
|
|||
"""
|
||||
id, country = self.parse_command_args(line, 2, 1)
|
||||
|
||||
movie = self.get_object(id, 'get_movie', ('original_title'), caps=ICapCinema)
|
||||
movie = self.get_object(id, 'get_movie', ('original_title'), caps=CapCinema)
|
||||
if not movie:
|
||||
print >>sys.stderr, 'Movie not found: %s' % id
|
||||
return 3
|
||||
|
||||
# i would like to clarify with fillobj but how could i fill the movie AND choose the country ?
|
||||
for backend, release in self.do('get_movie_releases', movie.id, country, caps=ICapCinema, backends=movie.backend):
|
||||
for backend, release in self.do('get_movie_releases', movie.id, country, caps=CapCinema, backends=movie.backend):
|
||||
if not empty(release):
|
||||
movie.all_release_dates = u'%s' % (release)
|
||||
else:
|
||||
|
|
@ -439,7 +439,7 @@ class Cineoob(ReplApplication):
|
|||
Get information about a torrent.
|
||||
"""
|
||||
|
||||
torrent = self.get_object(id, 'get_torrent', caps=ICapTorrent)
|
||||
torrent = self.get_object(id, 'get_torrent', caps=CapTorrent)
|
||||
if not torrent:
|
||||
print >>sys.stderr, 'Torrent not found: %s' % id
|
||||
return 3
|
||||
|
|
@ -470,7 +470,7 @@ class Cineoob(ReplApplication):
|
|||
dest = '%s.torrent' % _id
|
||||
|
||||
try:
|
||||
for backend, buf in self.do('get_torrent_file', _id, backends=backend_name, caps=ICapTorrent):
|
||||
for backend, buf in self.do('get_torrent_file', _id, backends=backend_name, caps=CapTorrent):
|
||||
if buf:
|
||||
if dest == '-':
|
||||
print buf
|
||||
|
|
@ -507,7 +507,7 @@ class Cineoob(ReplApplication):
|
|||
pattern = None
|
||||
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, torrent in self.do('iter_torrents', pattern=pattern, caps=ICapTorrent):
|
||||
for backend, torrent in self.do('iter_torrents', pattern=pattern, caps=CapTorrent):
|
||||
self.cached_format(torrent)
|
||||
|
||||
@defaultcount(10)
|
||||
|
|
@ -517,7 +517,7 @@ class Cineoob(ReplApplication):
|
|||
|
||||
Search torrents of movie_ID.
|
||||
"""
|
||||
movie = self.get_object(id, 'get_movie', ('original_title'), caps=ICapCinema)
|
||||
movie = self.get_object(id, 'get_movie', ('original_title'), caps=CapCinema)
|
||||
if not movie:
|
||||
print >>sys.stderr, 'Movie not found: %s' % id
|
||||
return 3
|
||||
|
|
@ -529,7 +529,7 @@ class Cineoob(ReplApplication):
|
|||
pattern = None
|
||||
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, torrent in self.do('iter_torrents', pattern=pattern, caps=ICapTorrent):
|
||||
for backend, torrent in self.do('iter_torrents', pattern=pattern, caps=CapTorrent):
|
||||
self.cached_format(torrent)
|
||||
|
||||
#================== SUBTITLE ==================
|
||||
|
|
@ -546,7 +546,7 @@ class Cineoob(ReplApplication):
|
|||
Get information about a subtitle.
|
||||
"""
|
||||
|
||||
subtitle = self.get_object(id, 'get_subtitle', caps=ICapCinema)
|
||||
subtitle = self.get_object(id, 'get_subtitle', caps=CapCinema)
|
||||
if not subtitle:
|
||||
print >>sys.stderr, 'Subtitle not found: %s' % id
|
||||
return 3
|
||||
|
|
@ -576,7 +576,7 @@ class Cineoob(ReplApplication):
|
|||
if dest is None:
|
||||
dest = '%s' % _id
|
||||
|
||||
for backend, buf in self.do('get_subtitle_file', _id, backends=backend_name, caps=ICapSubtitle):
|
||||
for backend, buf in self.do('get_subtitle_file', _id, backends=backend_name, caps=CapSubtitle):
|
||||
if buf:
|
||||
if dest == '-':
|
||||
print buf
|
||||
|
|
@ -625,7 +625,7 @@ class Cineoob(ReplApplication):
|
|||
pattern = None
|
||||
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, subtitle in self.do('iter_subtitles', language=language, pattern=pattern, caps=ICapSubtitle):
|
||||
for backend, subtitle in self.do('iter_subtitles', language=language, pattern=pattern, caps=CapSubtitle):
|
||||
self.cached_format(subtitle)
|
||||
|
||||
@defaultcount(10)
|
||||
|
|
@ -656,7 +656,7 @@ class Cineoob(ReplApplication):
|
|||
----------------------
|
||||
"""
|
||||
language, id = self.parse_command_args(line, 2, 2)
|
||||
movie = self.get_object(id, 'get_movie', ('original_title'), caps=ICapCinema)
|
||||
movie = self.get_object(id, 'get_movie', ('original_title'), caps=CapCinema)
|
||||
if not movie:
|
||||
print >>sys.stderr, 'Movie not found: %s' % id
|
||||
return 3
|
||||
|
|
@ -667,5 +667,5 @@ class Cineoob(ReplApplication):
|
|||
pattern = None
|
||||
|
||||
self.start_format(pattern=pattern)
|
||||
for backend, subtitle in self.do('iter_subtitles', language=language, pattern=pattern, caps=ICapSubtitle):
|
||||
for backend, subtitle in self.do('iter_subtitles', language=language, pattern=pattern, caps=CapSubtitle):
|
||||
self.cached_format(subtitle)
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.pricecomparison import ICapPriceComparison
|
||||
from weboob.capabilities.pricecomparison import CapPriceComparison
|
||||
from weboob.tools.misc import html2text
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
|
@ -88,7 +88,7 @@ class Comparoob(ReplApplication):
|
|||
COMMANDS_FORMATTERS = {'prices': 'prices',
|
||||
'info': 'price',
|
||||
}
|
||||
CAPS = ICapPriceComparison
|
||||
CAPS = CapPriceComparison
|
||||
|
||||
def do_prices(self, pattern):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
import sys
|
||||
import codecs
|
||||
|
||||
from weboob.capabilities.recipe import ICapRecipe
|
||||
from weboob.capabilities.recipe import CapRecipe
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
|
@ -79,7 +79,7 @@ class Cookboob(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2013 Julien Veyssier'
|
||||
DESCRIPTION = "Console application allowing to search for recipes on various websites."
|
||||
SHORT_DESCRIPTION = "search and consult recipes"
|
||||
CAPS = ICapRecipe
|
||||
CAPS = CapRecipe
|
||||
EXTRA_FORMATTERS = {'recipe_list': RecipeListFormatter,
|
||||
'recipe_info': RecipeInfoFormatter
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.housing import ICapHousing, Query
|
||||
from weboob.capabilities.housing import CapHousing, Query
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ class Flatboob(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2012 Romain Bignon'
|
||||
DESCRIPTION = "Console application to search for housing."
|
||||
SHORT_DESCRIPTION = "search for housing"
|
||||
CAPS = ICapHousing
|
||||
CAPS = CapHousing
|
||||
EXTRA_FORMATTERS = {'housing_list': HousingListFormatter,
|
||||
'housing': HousingFormatter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from re import search, sub
|
|||
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.capabilities.gallery import ICapGallery, BaseGallery, BaseImage
|
||||
from weboob.capabilities.gallery import CapGallery, BaseGallery, BaseImage
|
||||
from weboob.tools.application.formatters.iformatter import PrettyFormatter
|
||||
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ class Galleroob(ReplApplication):
|
|||
COPYRIGHT = u'Copyright(C) 2011 Noé Rubinstein'
|
||||
DESCRIPTION = 'galleroob browses and downloads web image galleries'
|
||||
SHORT_DESCRIPTION = 'browse and download web image galleries'
|
||||
CAPS = ICapGallery
|
||||
CAPS = CapGallery
|
||||
EXTRA_FORMATTERS = {'gallery_list': GalleryListFormatter}
|
||||
COMMANDS_FORMATTERS = {'search': 'gallery_list', 'ls': 'gallery_list'}
|
||||
COLLECTION_OBJECTS = (BaseGallery, BaseImage, )
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.geolocip import ICapGeolocIp
|
||||
from weboob.capabilities.geolocip import CapGeolocIp
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ class Geolooc(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
|
||||
DESCRIPTION = "Console application allowing to geolocalize IP addresses."
|
||||
SHORT_DESCRIPTION = "geolocalize IP addresses"
|
||||
CAPS = ICapGeolocIp
|
||||
CAPS = CapGeolocIp
|
||||
|
||||
def main(self, argv):
|
||||
if len(argv) < 2:
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.job import ICapJob
|
||||
from weboob.capabilities.job import CapJob
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ class Handjoob(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2012 Bezleputh'
|
||||
DESCRIPTION = "Console application to search for a job."
|
||||
SHORT_DESCRIPTION = "search for a job"
|
||||
CAPS = ICapJob
|
||||
CAPS = CapJob
|
||||
EXTRA_FORMATTERS = {'job_advert_list': JobAdvertListFormatter,
|
||||
'job_advert': JobAdvertFormatter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from copy import copy
|
|||
from weboob.core import CallErrors
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.applications.boobmsg import Boobmsg
|
||||
from weboob.capabilities.dating import ICapDating, OptimizationNotFound
|
||||
from weboob.capabilities.dating import CapDating, OptimizationNotFound
|
||||
from weboob.tools.application.formatters.iformatter import PrettyFormatter
|
||||
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ class HaveDate(Boobmsg):
|
|||
SHORT_DESCRIPTION = "interact with dating websites"
|
||||
STORAGE_FILENAME = 'dating.storage'
|
||||
STORAGE = {'optims': {}}
|
||||
CAPS = ICapDating
|
||||
CAPS = CapDating
|
||||
EXTRA_FORMATTERS = copy(Boobmsg.EXTRA_FORMATTERS)
|
||||
EXTRA_FORMATTERS['events'] = EventListFormatter
|
||||
COMMANDS_FORMATTERS = copy(Boobmsg.COMMANDS_FORMATTERS)
|
||||
|
|
@ -63,7 +63,7 @@ class HaveDate(Boobmsg):
|
|||
COMMANDS_FORMATTERS['events'] = 'events'
|
||||
|
||||
def load_default_backends(self):
|
||||
self.load_backends(ICapDating, storage=self.create_storage(self.STORAGE_FILENAME))
|
||||
self.load_backends(CapDating, storage=self.create_storage(self.STORAGE_FILENAME))
|
||||
|
||||
def main(self, argv):
|
||||
self.load_config()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.travel import ICapTravel
|
||||
from weboob.capabilities.travel import CapTravel
|
||||
from weboob.tools.application.base import BaseApplication
|
||||
from logging import warning
|
||||
|
||||
|
|
@ -284,6 +284,6 @@ class Masstransit(BaseApplication):
|
|||
SHORT_DESCRIPTION = "search for train stations and departures"
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapTravel)
|
||||
self.load_backends(CapTravel)
|
||||
MasstransitHildon(self.weboob)
|
||||
gtk.main()
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import socket
|
|||
|
||||
from weboob.core import Weboob, CallErrors
|
||||
from weboob.core.scheduler import Scheduler
|
||||
from weboob.capabilities.messages import ICapMessages, ICapMessagesPost, Thread, Message
|
||||
from weboob.capabilities.messages import CapMessages, CapMessagesPost, Thread, Message
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.misc import html2text, get_backtrace, utc2local, to_unicode
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ class Monboob(ReplApplication):
|
|||
'smtp': 'localhost',
|
||||
'pipe': '',
|
||||
'html': 0}
|
||||
CAPS = ICapMessages
|
||||
CAPS = CapMessages
|
||||
DISABLE_REPL = True
|
||||
|
||||
def add_application_options(self, group):
|
||||
|
|
@ -108,7 +108,7 @@ class Monboob(ReplApplication):
|
|||
return Weboob(scheduler=MonboobScheduler(self))
|
||||
|
||||
def load_default_backends(self):
|
||||
self.load_backends(ICapMessages, storage=self.create_storage())
|
||||
self.load_backends(CapMessages, storage=self.create_storage())
|
||||
|
||||
def main(self, argv):
|
||||
self.load_config()
|
||||
|
|
@ -221,8 +221,8 @@ class Monboob(ReplApplication):
|
|||
print >>sys.stderr, 'Backend %s not found' % bname
|
||||
return 1
|
||||
|
||||
if not backend.has_caps(ICapMessagesPost):
|
||||
print >>sys.stderr, 'The backend %s does not implement ICapMessagesPost' % bname
|
||||
if not backend.has_caps(CapMessagesPost):
|
||||
print >>sys.stderr, 'The backend %s does not implement CapMessagesPost' % bname
|
||||
return 1
|
||||
|
||||
thread = Thread(thread_id)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
import sys
|
||||
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.capabilities.parcel import ICapParcel, Parcel
|
||||
from weboob.capabilities.parcel import CapParcel, Parcel
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ class Parceloob(ReplApplication):
|
|||
APPNAME = 'parceloob'
|
||||
VERSION = '0.j'
|
||||
COPYRIGHT = 'Copyright(C) 2013 Romain Bignon'
|
||||
CAPS = ICapParcel
|
||||
CAPS = CapParcel
|
||||
DESCRIPTION = "Console application to track your parcels."
|
||||
SHORT_DESCRIPTION = "manage your parcels"
|
||||
EXTRA_FORMATTERS = {'status': StatusFormatter,
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import locale
|
|||
import re
|
||||
from random import choice
|
||||
|
||||
from weboob.capabilities.paste import ICapPaste, PasteNotFound
|
||||
from weboob.capabilities.paste import CapPaste, PasteNotFound
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ class Pastoob(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2011-2013 Laurent Bachelier'
|
||||
DESCRIPTION = "Console application allowing to post and get pastes from pastebins."
|
||||
SHORT_DESCRIPTION = "post and get pastes from pastebins"
|
||||
CAPS = ICapPaste
|
||||
CAPS = CapPaste
|
||||
|
||||
def main(self, argv):
|
||||
self.load_config()
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from PyQt4.QtCore import SIGNAL
|
|||
|
||||
from weboob.tools.application.qt import QtMainWindow
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
from weboob.capabilities.messages import ICapMessages
|
||||
from weboob.capabilities.messages import CapMessages
|
||||
|
||||
from .ui.main_window_ui import Ui_MainWindow
|
||||
from .messages_manager import MessagesManager
|
||||
|
|
@ -48,7 +48,7 @@ class MainWindow(QtMainWindow):
|
|||
self.centralWidget().load()
|
||||
|
||||
def backendsConfig(self):
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapMessages,), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapMessages,), self)
|
||||
if bckndcfg.run():
|
||||
self.centralWidget().load()
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import logging
|
|||
from PyQt4.QtGui import QWidget, QTreeWidgetItem, QListWidgetItem, QMessageBox, QBrush
|
||||
from PyQt4.QtCore import SIGNAL, Qt
|
||||
|
||||
from weboob.capabilities.messages import ICapMessages, ICapMessagesPost, Message
|
||||
from weboob.capabilities.messages import CapMessages, CapMessagesPost, Message
|
||||
from weboob.tools.application.qt import QtDo
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ class MessagesManager(QWidget):
|
|||
self.ui.backendsList.clear()
|
||||
self.ui.backendsList.addItem('(All)')
|
||||
for backend in self.weboob.iter_backends():
|
||||
if not backend.has_caps(ICapMessages):
|
||||
if not backend.has_caps(CapMessages):
|
||||
continue
|
||||
|
||||
item = QListWidgetItem(backend.name.capitalize())
|
||||
|
|
@ -87,7 +87,7 @@ class MessagesManager(QWidget):
|
|||
self.ui.threadsList.setEnabled(False)
|
||||
|
||||
self.process_threads = QtDo(self.weboob, self._gotThread)
|
||||
self.process_threads.do('iter_threads', backends=self.backend, caps=ICapMessages)
|
||||
self.process_threads.do('iter_threads', backends=self.backend, caps=CapMessages)
|
||||
|
||||
def _gotThread(self, backend, thread):
|
||||
if not backend:
|
||||
|
|
@ -166,7 +166,7 @@ class MessagesManager(QWidget):
|
|||
|
||||
def showMessage(self, message, item=None):
|
||||
backend = self.weboob.get_backend(message.thread.backend)
|
||||
if backend.has_caps(ICapMessagesPost):
|
||||
if backend.has_caps(CapMessagesPost):
|
||||
self.ui.replyButton.setEnabled(True)
|
||||
self.message = message
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.messages import ICapMessages
|
||||
from weboob.capabilities.messages import CapMessages
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
|
@ -30,10 +30,10 @@ class QBoobMsg(QtApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
|
||||
DESCRIPTION = "Qt application allowing to read messages on various websites and reply to them."
|
||||
SHORT_DESCRIPTION = "send and receive message threads"
|
||||
CAPS = ICapMessages
|
||||
CAPS = CapMessages
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapMessages, storage=self.create_storage())
|
||||
self.load_backends(CapMessages, storage=self.create_storage())
|
||||
|
||||
self.main_window = MainWindow(self.config, self.weboob)
|
||||
self.main_window.show()
|
||||
|
|
|
|||
|
|
@ -23,9 +23,9 @@ import codecs
|
|||
from PyQt4.QtCore import SIGNAL, Qt, QStringList
|
||||
from PyQt4.QtGui import QApplication, QCompleter, QFrame, QShortcut, QKeySequence
|
||||
|
||||
from weboob.capabilities.cinema import ICapCinema
|
||||
from weboob.capabilities.torrent import ICapTorrent
|
||||
from weboob.capabilities.subtitle import ICapSubtitle
|
||||
from weboob.capabilities.cinema import CapCinema
|
||||
from weboob.capabilities.torrent import CapTorrent
|
||||
from weboob.capabilities.subtitle import CapSubtitle
|
||||
from weboob.tools.application.qt import QtMainWindow, QtDo
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
|
||||
|
|
@ -99,7 +99,7 @@ class Result(QFrame):
|
|||
QApplication.setOverrideCursor(Qt.WaitCursor)
|
||||
|
||||
self.process = QtDo(self.weboob, self.addPerson)
|
||||
self.process.do('iter_movie_persons', id, role, backends=backend_name, caps=ICapCinema)
|
||||
self.process.do('iter_movie_persons', id, role, backends=backend_name, caps=CapCinema)
|
||||
self.parent.ui.stopButton.show()
|
||||
|
||||
def filmographyAction(self, backend_name, id, role):
|
||||
|
|
@ -114,7 +114,7 @@ class Result(QFrame):
|
|||
QApplication.setOverrideCursor(Qt.WaitCursor)
|
||||
|
||||
self.process = QtDo(self.weboob, self.addMovie)
|
||||
self.process.do('iter_person_movies', id, role, backends=backend_name, caps=ICapCinema)
|
||||
self.process.do('iter_person_movies', id, role, backends=backend_name, caps=CapCinema)
|
||||
self.parent.ui.stopButton.show()
|
||||
|
||||
def search(self, tosearch, pattern, lang):
|
||||
|
|
@ -146,8 +146,8 @@ class Result(QFrame):
|
|||
backend_name = str(self.parent.ui.backendEdit.itemData(self.parent.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addMovie)
|
||||
#self.process.do('iter_movies', pattern, backends=backend_name, caps=ICapCinema)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('original_title'), 'iter_movies', pattern, backends=backend_name, caps=ICapCinema)
|
||||
#self.process.do('iter_movies', pattern, backends=backend_name, caps=CapCinema)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('original_title'), 'iter_movies', pattern, backends=backend_name, caps=CapCinema)
|
||||
self.parent.ui.stopButton.show()
|
||||
|
||||
def stopProcess(self):
|
||||
|
|
@ -194,8 +194,8 @@ class Result(QFrame):
|
|||
backend_name = str(self.parent.ui.backendEdit.itemData(self.parent.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addPerson)
|
||||
#self.process.do('iter_persons', pattern, backends=backend_name, caps=ICapCinema)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('name'), 'iter_persons', pattern, backends=backend_name, caps=ICapCinema)
|
||||
#self.process.do('iter_persons', pattern, backends=backend_name, caps=CapCinema)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('name'), 'iter_persons', pattern, backends=backend_name, caps=CapCinema)
|
||||
self.parent.ui.stopButton.show()
|
||||
|
||||
def addPerson(self, backend, person):
|
||||
|
|
@ -239,8 +239,8 @@ class Result(QFrame):
|
|||
backend_name = str(self.parent.ui.backendEdit.itemData(self.parent.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addTorrent)
|
||||
#self.process.do('iter_torrents', pattern, backends=backend_name, caps=ICapTorrent)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('name'), 'iter_torrents', pattern, backends=backend_name, caps=ICapTorrent)
|
||||
#self.process.do('iter_torrents', pattern, backends=backend_name, caps=CapTorrent)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('name'), 'iter_torrents', pattern, backends=backend_name, caps=CapTorrent)
|
||||
self.parent.ui.stopButton.show()
|
||||
|
||||
def addTorrent(self, backend, torrent):
|
||||
|
|
@ -283,8 +283,8 @@ class Result(QFrame):
|
|||
backend_name = str(self.parent.ui.backendEdit.itemData(self.parent.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addSubtitle)
|
||||
#self.process.do('iter_subtitles', lang, pattern, backends=backend_name, caps=ICapSubtitle)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('name'), 'iter_subtitles', lang, pattern, backends=backend_name, caps=ICapSubtitle)
|
||||
#self.process.do('iter_subtitles', lang, pattern, backends=backend_name, caps=CapSubtitle)
|
||||
self.process.do(self.app._do_complete, self.parent.getCount(), ('name'), 'iter_subtitles', lang, pattern, backends=backend_name, caps=CapSubtitle)
|
||||
self.parent.ui.stopButton.show()
|
||||
|
||||
def addSubtitle(self, backend, subtitle):
|
||||
|
|
@ -312,14 +312,14 @@ class Result(QFrame):
|
|||
QApplication.setOverrideCursor(Qt.WaitCursor)
|
||||
title_field = 'name'
|
||||
if stype == 'movie':
|
||||
cap = ICapCinema
|
||||
cap = CapCinema
|
||||
title_field = 'original_title'
|
||||
elif stype == 'person':
|
||||
cap = ICapCinema
|
||||
cap = CapCinema
|
||||
elif stype == 'torrent':
|
||||
cap = ICapTorrent
|
||||
cap = CapTorrent
|
||||
elif stype == 'subtitle':
|
||||
cap = ICapSubtitle
|
||||
cap = CapSubtitle
|
||||
if '@' in id:
|
||||
backend_name = id.split('@')[1]
|
||||
id = id.split('@')[0]
|
||||
|
|
@ -455,7 +455,7 @@ class MainWindow(QtMainWindow):
|
|||
new_res.searchId(id, stype)
|
||||
|
||||
def backendsConfig(self):
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapCinema, ICapTorrent, ICapSubtitle,), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapCinema, CapTorrent, CapSubtitle,), self)
|
||||
if bckndcfg.run():
|
||||
self.loadBackendsList()
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.cinema import ICapCinema
|
||||
from weboob.capabilities.torrent import ICapTorrent
|
||||
from weboob.capabilities.subtitle import ICapSubtitle
|
||||
from weboob.capabilities.cinema import CapCinema
|
||||
from weboob.capabilities.torrent import CapTorrent
|
||||
from weboob.capabilities.subtitle import CapSubtitle
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
|
@ -32,7 +32,7 @@ class QCineoob(QtApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2013 Julien Veyssier'
|
||||
DESCRIPTION = "Qt application allowing to search movies, people, torrent and subtitles."
|
||||
SHORT_DESCRIPTION = "search movies, people, torrent and subtitles"
|
||||
CAPS = ICapCinema, ICapTorrent, ICapSubtitle
|
||||
CAPS = CapCinema, CapTorrent, CapSubtitle
|
||||
CONFIG = {'settings': {'backend': '',
|
||||
'maxresultsnumber': '10',
|
||||
'showthumbnails': '0'
|
||||
|
|
@ -40,7 +40,7 @@ class QCineoob(QtApplication):
|
|||
}
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends([ICapCinema, ICapTorrent, ICapSubtitle])
|
||||
self.load_backends([CapCinema, CapTorrent, CapSubtitle])
|
||||
self.load_config()
|
||||
|
||||
self.main_window = MainWindow(self.config, self.weboob, self)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import codecs
|
|||
from PyQt4.QtCore import SIGNAL, Qt, QStringList
|
||||
from PyQt4.QtGui import QApplication, QCompleter
|
||||
|
||||
from weboob.capabilities.recipe import ICapRecipe
|
||||
from weboob.capabilities.recipe import CapRecipe
|
||||
from weboob.tools.application.qt import QtMainWindow, QtDo
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ class MainWindow(QtMainWindow):
|
|||
self.backendsConfig()
|
||||
|
||||
def backendsConfig(self):
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapRecipe, ), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapRecipe, ), self)
|
||||
if bckndcfg.run():
|
||||
self.loadBackendsList()
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ class MainWindow(QtMainWindow):
|
|||
backend_name = str(self.ui.backendEdit.itemData(self.ui.backendEdit.currentIndex()).toString())
|
||||
|
||||
self.process = QtDo(self.weboob, self.addRecipe)
|
||||
self.process.do(self.app._do_complete, self.getCount(), ('title'), 'iter_recipes', pattern, backends=backend_name, caps=ICapRecipe)
|
||||
self.process.do(self.app._do_complete, self.getCount(), ('title'), 'iter_recipes', pattern, backends=backend_name, caps=CapRecipe)
|
||||
self.ui.stopButton.show()
|
||||
|
||||
def addRecipe(self, backend, recipe):
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.recipe import ICapRecipe
|
||||
from weboob.capabilities.recipe import CapRecipe
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
|
@ -30,14 +30,14 @@ class QCookboob(QtApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2013 Julien Veyssier'
|
||||
DESCRIPTION = "Qt application allowing to search recipes."
|
||||
SHORT_DESCRIPTION = "search recipes"
|
||||
CAPS = ICapRecipe
|
||||
CAPS = CapRecipe
|
||||
CONFIG = {'settings': {'backend': '',
|
||||
'maxresultsnumber': '10'
|
||||
}
|
||||
}
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends([ICapRecipe])
|
||||
self.load_backends([CapRecipe])
|
||||
self.load_config()
|
||||
|
||||
self.main_window = MainWindow(self.config, self.weboob, self)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from decimal import Decimal
|
|||
|
||||
from weboob.tools.application.qt import QtMainWindow, QtDo, HTMLDelegate
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
from weboob.capabilities.housing import ICapHousing, Query, City
|
||||
from weboob.capabilities.housing import CapHousing, Query, City
|
||||
from weboob.capabilities.base import NotLoaded, NotAvailable
|
||||
|
||||
from .ui.main_window_ui import Ui_MainWindow
|
||||
|
|
@ -101,7 +101,7 @@ class MainWindow(QtMainWindow):
|
|||
QtMainWindow.closeEvent(self, event)
|
||||
|
||||
def backendsConfig(self):
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapHousing,), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapHousing,), self)
|
||||
if bckndcfg.run():
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.housing import ICapHousing
|
||||
from weboob.capabilities.housing import CapHousing
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
from weboob.tools.config.yamlconfig import YamlConfig
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ class QFlatBoob(QtApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2012 Romain Bignon'
|
||||
DESCRIPTION = "Qt application to search for housing."
|
||||
SHORT_DESCRIPTION = "search for housing"
|
||||
CAPS = ICapHousing
|
||||
CAPS = CapHousing
|
||||
CONFIG = {'queries': {}}
|
||||
STORAGE = {'bookmarks': [], 'read': [], 'notes': {}}
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapHousing)
|
||||
self.load_backends(CapHousing)
|
||||
self.create_storage()
|
||||
self.load_config(klass=YamlConfig)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from PyQt4.QtCore import SIGNAL, Qt, QStringList
|
|||
|
||||
from weboob.tools.application.qt import QtMainWindow, QtDo
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
from weboob.capabilities.job import ICapJob
|
||||
from weboob.capabilities.job import CapJob
|
||||
|
||||
from .ui.main_window_ui import Ui_MainWindow
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ class MainWindow(QtMainWindow):
|
|||
QtMainWindow.closeEvent(self, event)
|
||||
|
||||
def backendsConfig(self):
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapJob,), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapJob,), self)
|
||||
if bckndcfg.run():
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.job import ICapJob
|
||||
from weboob.capabilities.job import CapJob
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
from weboob.tools.config.yamlconfig import YamlConfig
|
||||
|
||||
|
|
@ -31,12 +31,12 @@ class QHandJoob(QtApplication):
|
|||
COPYRIGHT = u'Copyright(C) 2013 Sébastien Monel'
|
||||
DESCRIPTION = "Qt application to search for job."
|
||||
SHORT_DESCRIPTION = "search for job"
|
||||
CAPS = ICapJob
|
||||
CAPS = CapJob
|
||||
CONFIG = {'queries': {}}
|
||||
STORAGE = {'bookmarks': [], 'read': [], 'notes': {}}
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapJob)
|
||||
self.load_backends(CapJob)
|
||||
self.create_storage()
|
||||
self.load_config(klass=YamlConfig)
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ from PyQt4.QtCore import SIGNAL, Qt
|
|||
|
||||
from weboob.tools.application.qt import QtDo, HTMLDelegate
|
||||
from weboob.tools.misc import to_unicode
|
||||
from weboob.capabilities.contact import ICapContact, Contact
|
||||
from weboob.capabilities.chat import ICapChat
|
||||
from weboob.capabilities.messages import ICapMessages, ICapMessagesPost, Message
|
||||
from weboob.capabilities.contact import CapContact, Contact
|
||||
from weboob.capabilities.chat import CapChat
|
||||
from weboob.capabilities.messages import CapMessages, CapMessagesPost, Message
|
||||
from weboob.capabilities.base import NotLoaded
|
||||
|
||||
from .ui.contacts_ui import Ui_Contacts
|
||||
|
|
@ -426,7 +426,7 @@ class MetaGroup(IGroup):
|
|||
status = Contact.STATUS_ALL
|
||||
|
||||
self.process = QtDo(self.weboob, lambda b, d: self.cb(cb, b, d))
|
||||
self.process.do('iter_contacts', status, caps=ICapContact)
|
||||
self.process.do('iter_contacts', status, caps=CapContact)
|
||||
|
||||
def cb(self, cb, backend, contact):
|
||||
if contact:
|
||||
|
|
@ -559,9 +559,9 @@ class ContactsWidget(QWidget):
|
|||
backend = self.weboob.get_backend(self.contact.backend)
|
||||
|
||||
self.ui.tabWidget.addTab(ContactProfile(self.weboob, self.contact), self.tr('Profile'))
|
||||
if backend.has_caps(ICapMessages):
|
||||
self.ui.tabWidget.addTab(ContactThread(self.weboob, self.contact, backend.has_caps(ICapMessagesPost)), self.tr('Messages'))
|
||||
if backend.has_caps(ICapChat):
|
||||
if backend.has_caps(CapMessages):
|
||||
self.ui.tabWidget.addTab(ContactThread(self.weboob, self.contact, backend.has_caps(CapMessagesPost)), self.tr('Messages'))
|
||||
if backend.has_caps(CapChat):
|
||||
self.ui.tabWidget.setTabEnabled(self.ui.tabWidget.addTab(QWidget(), self.tr('Chat')),
|
||||
False)
|
||||
self.ui.tabWidget.setTabEnabled(self.ui.tabWidget.addTab(QWidget(), self.tr('Calendar')),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from PyQt4.QtCore import SIGNAL
|
|||
|
||||
from weboob.tools.application.qt import QtMainWindow
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
from weboob.capabilities.dating import ICapDating
|
||||
from weboob.capabilities.dating import CapDating
|
||||
|
||||
try:
|
||||
from weboob.applications.qboobmsg.messages_manager import MessagesManager
|
||||
|
|
@ -61,7 +61,7 @@ class MainWindow(QtMainWindow):
|
|||
self.backendsConfig()
|
||||
|
||||
def backendsConfig(self):
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapDating,), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapDating,), self)
|
||||
if bckndcfg.run():
|
||||
self.loaded_tabs.clear()
|
||||
widget = self.ui.tabWidget.widget(self.ui.tabWidget.currentIndex())
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.dating import ICapDating
|
||||
from weboob.capabilities.dating import CapDating
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
|
@ -30,12 +30,12 @@ class QHaveDate(QtApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2012 Romain Bignon'
|
||||
DESCRIPTION = "Qt application allowing to interact with various dating websites."
|
||||
SHORT_DESCRIPTION = "interact with dating websites"
|
||||
CAPS = ICapDating
|
||||
CAPS = CapDating
|
||||
STORAGE_FILENAME = 'dating.storage'
|
||||
|
||||
def main(self, argv):
|
||||
self.create_storage(self.STORAGE_FILENAME)
|
||||
self.load_backends(ICapDating)
|
||||
self.load_backends(CapDating)
|
||||
|
||||
self.main_window = MainWindow(self.config, self.weboob)
|
||||
self.main_window.show()
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
from PyQt4.QtGui import QScrollArea, QWidget, QHBoxLayout, QVBoxLayout, QFrame, QLabel, QImage, QPixmap
|
||||
|
||||
from weboob.capabilities.account import ICapAccount, StatusField
|
||||
from weboob.capabilities.account import CapAccount, StatusField
|
||||
from weboob.tools.application.qt import QtDo
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ class Account(QFrame):
|
|||
|
||||
self.layout().addWidget(headw)
|
||||
|
||||
if backend.has_caps(ICapAccount):
|
||||
if backend.has_caps(CapAccount):
|
||||
self.body.setText(u'<i>Waiting...</i>')
|
||||
self.layout().addWidget(self.body)
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
from PyQt4.QtCore import SIGNAL
|
||||
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
from weboob.capabilities.video import CapVideo
|
||||
from weboob.tools.application.qt import QtMainWindow, QtDo
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ class MainWindow(QtMainWindow):
|
|||
self.backendsConfig()
|
||||
|
||||
def backendsConfig(self):
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapVideo,), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapVideo,), self)
|
||||
if bckndcfg.run():
|
||||
self.loadBackendsList()
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.video import ICapVideo
|
||||
from weboob.capabilities.video import CapVideo
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
|
@ -30,7 +30,7 @@ class QVideoob(QtApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
|
||||
DESCRIPTION = "Qt application allowing to search videos on various websites and play them."
|
||||
SHORT_DESCRIPTION = "search and play videos"
|
||||
CAPS = ICapVideo
|
||||
CAPS = CapVideo
|
||||
CONFIG = {'settings': {'nsfw': 1,
|
||||
'sfw': 1,
|
||||
'sortby': 0,
|
||||
|
|
@ -39,7 +39,7 @@ class QVideoob(QtApplication):
|
|||
}
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapVideo)
|
||||
self.load_backends(CapVideo)
|
||||
self.load_config()
|
||||
|
||||
self.main_window = MainWindow(self.config, self.weboob, self)
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from PyQt4.QtCore import Qt
|
|||
from weboob.tools.application.base import MoreResultsAvailable
|
||||
from weboob.tools.application.qt import QtMainWindow, QtDo
|
||||
from weboob.tools.application.qt.backendcfg import BackendCfg
|
||||
from weboob.capabilities.content import ICapContent
|
||||
from weboob.capabilities.content import CapContent
|
||||
from weboob.tools.misc import to_unicode
|
||||
|
||||
from .ui.main_window_ui import Ui_MainWindow
|
||||
|
|
@ -75,7 +75,7 @@ class MainWindow(QtMainWindow):
|
|||
|
||||
def backendsConfig(self):
|
||||
""" Opens backends configuration dialog when 'Backends' is clicked """
|
||||
bckndcfg = BackendCfg(self.weboob, (ICapContent,), self)
|
||||
bckndcfg = BackendCfg(self.weboob, (CapContent,), self)
|
||||
if bckndcfg.run():
|
||||
self.loadBackends()
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from weboob.tools.application.qt import QtApplication
|
||||
from weboob.capabilities.content import ICapContent
|
||||
from weboob.capabilities.content import CapContent
|
||||
|
||||
from .main_window import MainWindow
|
||||
|
||||
|
|
@ -29,10 +29,10 @@ class QWebContentEdit(QtApplication):
|
|||
COPYRIGHT = u'Copyright(C) 2011 Clément Schreiner'
|
||||
DESCRIPTION = "Qt application allowing to manage content of various websites."
|
||||
SHORT_DESCRIPTION = "manage websites content"
|
||||
CAPS = ICapContent
|
||||
CAPS = CapContent
|
||||
|
||||
def main(self, argv):
|
||||
self.load_backends(ICapContent, storage=self.create_storage())
|
||||
self.load_backends(CapContent, storage=self.create_storage())
|
||||
self.main_window = MainWindow(self.config, self.weboob, self)
|
||||
self.main_window.show()
|
||||
return self.weboob.loop()
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ import os
|
|||
import re
|
||||
import requests
|
||||
|
||||
from weboob.capabilities.radio import ICapRadio, Radio
|
||||
from weboob.capabilities.audio import ICapAudio, BaseAudio, Playlist, Album
|
||||
from weboob.capabilities.radio import CapRadio, Radio
|
||||
from weboob.capabilities.audio import CapAudio, BaseAudio, Playlist, Album
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.media_player import InvalidMediaPlayer, MediaPlayer, MediaPlayerNotFound
|
||||
|
|
@ -129,7 +129,7 @@ class Radioob(ReplApplication):
|
|||
DESCRIPTION = "Console application allowing to search for web radio stations, listen to them and get information " \
|
||||
"like the current song."
|
||||
SHORT_DESCRIPTION = "search, show or listen to radio stations"
|
||||
CAPS = (ICapRadio, ICapAudio)
|
||||
CAPS = (CapRadio, CapAudio)
|
||||
EXTRA_FORMATTERS = {'radio_list': RadioListFormatter,
|
||||
'song_list': SongListFormatter,
|
||||
'album_tracks_list_info': AlbumTrackListInfoFormatter,
|
||||
|
|
@ -301,7 +301,7 @@ class Radioob(ReplApplication):
|
|||
except (IndexError, ValueError):
|
||||
pass
|
||||
|
||||
m = ICapAudio.get_object_method(_id)
|
||||
m = CapAudio.get_object_method(_id)
|
||||
if m:
|
||||
obj = self.get_object(_id, m)
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.subtitle import ICapSubtitle
|
||||
from weboob.capabilities.subtitle import CapSubtitle
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
|
@ -92,7 +92,7 @@ class Suboob(ReplApplication):
|
|||
DESCRIPTION = "Console application allowing to search for subtitles on various services " \
|
||||
"and download them."
|
||||
SHORT_DESCRIPTION = "search and download subtitles"
|
||||
CAPS = ICapSubtitle
|
||||
CAPS = CapSubtitle
|
||||
EXTRA_FORMATTERS = {'subtitle_list': SubtitleListFormatter,
|
||||
'subtitle_info': SubtitleInfoFormatter
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
|
||||
import sys
|
||||
from weboob.capabilities.translate import ICapTranslate, TranslationFail, LanguageNotSupported
|
||||
from weboob.capabilities.translate import CapTranslate, TranslationFail, LanguageNotSupported
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter
|
||||
|
||||
|
|
@ -51,7 +51,7 @@ class Translaboob(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2012 Lucien Loiseau'
|
||||
DESCRIPTION = "Console application to translate text from one language to another"
|
||||
SHORT_DESCRIPTION = "translate text from one language to another"
|
||||
CAPS = ICapTranslate
|
||||
CAPS = CapTranslate
|
||||
EXTRA_FORMATTERS = {'translation': TranslationFormatter,
|
||||
'xmltrans': XmlTranslationFormatter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import sys
|
|||
import datetime
|
||||
|
||||
from weboob.capabilities.base import Currency, empty
|
||||
from weboob.capabilities.travel import ICapTravel, RoadmapFilters
|
||||
from weboob.capabilities.travel import CapTravel, RoadmapFilters
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import PrettyFormatter
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ class Traveloob(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2013 Romain Bignon'
|
||||
DESCRIPTION = "Console application allowing to search for train stations and get departure times."
|
||||
SHORT_DESCRIPTION = "search for train stations and departures"
|
||||
CAPS = ICapTravel
|
||||
CAPS = CapTravel
|
||||
DEFAULT_FORMATTER = 'table'
|
||||
EXTRA_FORMATTERS = {'stations': StationsFormatter,
|
||||
'departures': DeparturesFormatter,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import subprocess
|
|||
import sys
|
||||
import os
|
||||
|
||||
from weboob.capabilities.video import ICapVideo, BaseVideo
|
||||
from weboob.capabilities.video import CapVideo, BaseVideo
|
||||
from weboob.capabilities.base import empty
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.media_player import InvalidMediaPlayer, MediaPlayer, MediaPlayerNotFound
|
||||
|
|
@ -58,7 +58,7 @@ class Videoob(ReplApplication):
|
|||
DESCRIPTION = "Console application allowing to search for videos on various websites, " \
|
||||
"play and download them and get information."
|
||||
SHORT_DESCRIPTION = "search and play videos"
|
||||
CAPS = ICapVideo
|
||||
CAPS = CapVideo
|
||||
EXTRA_FORMATTERS = {'video_list': VideoListFormatter}
|
||||
COMMANDS_FORMATTERS = {'search': 'video_list',
|
||||
'ls': 'video_list',
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ import locale
|
|||
import codecs
|
||||
|
||||
from weboob.core.bcall import CallErrors
|
||||
from weboob.capabilities.content import ICapContent, Revision
|
||||
from weboob.capabilities.content import CapContent, Revision
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
|
||||
|
||||
|
|
@ -38,7 +38,7 @@ class WebContentEdit(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
|
||||
DESCRIPTION = "Console application allowing to display and edit contents on various websites."
|
||||
SHORT_DESCRIPTION = "manage websites content"
|
||||
CAPS = ICapContent
|
||||
CAPS = CapContent
|
||||
|
||||
def do_edit(self, line):
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import os
|
|||
import sys
|
||||
import re
|
||||
|
||||
from weboob.capabilities.account import ICapAccount
|
||||
from weboob.capabilities.account import CapAccount
|
||||
from weboob.core.modules import ModuleLoadError
|
||||
from weboob.tools.application.repl import ReplApplication
|
||||
from weboob.tools.ordereddict import OrderedDict
|
||||
|
|
@ -100,7 +100,7 @@ class WeboobCfg(ReplApplication):
|
|||
print >>sys.stderr, 'Error: backend "%s" not found.' % backend_name
|
||||
return 1
|
||||
|
||||
if not backend.has_caps(ICapAccount):
|
||||
if not backend.has_caps(CapAccount):
|
||||
print >>sys.stderr, 'Error: backend "%s" does not support accounts management' % backend_name
|
||||
return 1
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
import sys
|
||||
|
||||
from weboob.capabilities.torrent import ICapTorrent, MagnetOnly
|
||||
from weboob.capabilities.torrent import CapTorrent, MagnetOnly
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
from weboob.core import CallErrors
|
||||
|
|
@ -96,7 +96,7 @@ class Weboorrents(ReplApplication):
|
|||
DESCRIPTION = "Console application allowing to search for torrents on various trackers " \
|
||||
"and download .torrent files."
|
||||
SHORT_DESCRIPTION = "search and download torrents"
|
||||
CAPS = ICapTorrent
|
||||
CAPS = CapTorrent
|
||||
EXTRA_FORMATTERS = {'torrent_list': TorrentListFormatter,
|
||||
'torrent_info': TorrentInfoFormatter,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from weboob.capabilities.weather import ICapWeather
|
||||
from weboob.capabilities.weather import CapWeather
|
||||
from weboob.tools.application.repl import ReplApplication, defaultcount
|
||||
from weboob.tools.application.formatters.iformatter import IFormatter, PrettyFormatter
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ class WetBoobs(ReplApplication):
|
|||
COPYRIGHT = 'Copyright(C) 2010-2014 Romain Bignon'
|
||||
DESCRIPTION = "Console application allowing to display weather and forecasts in your city."
|
||||
SHORT_DESCRIPTION = "display weather and forecasts"
|
||||
CAPS = ICapWeather
|
||||
CAPS = CapWeather
|
||||
DEFAULT_FORMATTER = 'table'
|
||||
EXTRA_FORMATTERS = {'cities': CitiesFormatter,
|
||||
'current': CurrentFormatter,
|
||||
|
|
@ -87,7 +87,7 @@ class WetBoobs(ReplApplication):
|
|||
"""
|
||||
self.change_path(['cities'])
|
||||
self.start_format()
|
||||
for backend, city in self.do('iter_city_search', pattern, caps=ICapWeather):
|
||||
for backend, city in self.do('iter_city_search', pattern, caps=CapWeather):
|
||||
self.cached_format(city)
|
||||
|
||||
def complete_current(self, text, line, *ignored):
|
||||
|
|
@ -111,7 +111,7 @@ class WetBoobs(ReplApplication):
|
|||
self.formatter.temperature_display = lambda t: t.asfahrenheit()
|
||||
|
||||
self.start_format()
|
||||
for backend, current in self.do('get_current', _id, backends=backend_name, caps=ICapWeather):
|
||||
for backend, current in self.do('get_current', _id, backends=backend_name, caps=CapWeather):
|
||||
if current:
|
||||
self.format(current)
|
||||
|
||||
|
|
@ -136,5 +136,5 @@ class WetBoobs(ReplApplication):
|
|||
self.formatter.temperature_display = lambda t: t.asfahrenheit()
|
||||
self.start_format()
|
||||
|
||||
for backend, forecast in self.do('iter_forecast', _id, backends=backend_name, caps=ICapWeather):
|
||||
for backend, forecast in self.do('iter_forecast', _id, backends=backend_name, caps=CapWeather):
|
||||
self.format(forecast)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, StringField, Field, UserError
|
||||
|
||||
|
||||
__all__ = ['AccountRegisterError', 'Account', 'StatusField', 'ICapAccount']
|
||||
__all__ = ['AccountRegisterError', 'Account', 'StatusField', 'CapAccount']
|
||||
|
||||
|
||||
class AccountRegisterError(UserError):
|
||||
|
|
@ -56,7 +56,7 @@ class StatusField(object):
|
|||
self.flags = flags
|
||||
|
||||
|
||||
class ICapAccount(IBaseCap):
|
||||
class CapAccount(IBaseCap):
|
||||
"""
|
||||
Capability for websites when you can create and manage accounts.
|
||||
|
||||
|
|
|
|||
|
|
@ -23,10 +23,10 @@ from datetime import timedelta
|
|||
|
||||
from .image import BaseImage
|
||||
from .base import Field, StringField, IntField, BaseObject
|
||||
from .file import ICapFile, BaseFile
|
||||
from .file import CapFile, BaseFile
|
||||
|
||||
|
||||
__all__ = ['BaseAudio', 'ICapAudio']
|
||||
__all__ = ['BaseAudio', 'CapAudio']
|
||||
|
||||
|
||||
def decode_id(decode_id):
|
||||
|
|
@ -106,7 +106,7 @@ class BaseAudio(BaseFile):
|
|||
return _id
|
||||
|
||||
|
||||
class ICapAudio(ICapFile):
|
||||
class CapAudio(CapFile):
|
||||
"""
|
||||
Audio file provider
|
||||
"""
|
||||
|
|
@ -124,7 +124,7 @@ class ICapAudio(ICapFile):
|
|||
else:
|
||||
return 'get_audio'
|
||||
|
||||
def search_audio(self, pattern, sortby=ICapFile.SEARCH_RELEVANCE):
|
||||
def search_audio(self, pattern, sortby=CapFile.SEARCH_RELEVANCE):
|
||||
"""
|
||||
search for a audio file
|
||||
|
||||
|
|
@ -135,7 +135,7 @@ class ICapAudio(ICapFile):
|
|||
"""
|
||||
return self.search_file(pattern, sortby)
|
||||
|
||||
def search_album(self, pattern, sortby=ICapFile.SEARCH_RELEVANCE):
|
||||
def search_album(self, pattern, sortby=CapFile.SEARCH_RELEVANCE):
|
||||
"""
|
||||
search for an album
|
||||
:param pattern: pattern to search on
|
||||
|
|
@ -144,7 +144,7 @@ class ICapAudio(ICapFile):
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def search_playlist(self, pattern, sortby=ICapFile.SEARCH_RELEVANCE):
|
||||
def search_playlist(self, pattern, sortby=CapFile.SEARCH_RELEVANCE):
|
||||
"""
|
||||
search for an album
|
||||
:param pattern: pattern to search on
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
from weboob.tools.capabilities.streaminfo import StreamInfo
|
||||
from .base import Field
|
||||
from .file import ICapFile
|
||||
from .audio import ICapAudio, BaseAudio
|
||||
from .file import CapFile
|
||||
from .audio import CapAudio, BaseAudio
|
||||
|
||||
|
||||
__all__ = ['BaseAudioStream', 'ICapAudioStream']
|
||||
__all__ = ['BaseAudioStream', 'CapAudioStream']
|
||||
|
||||
|
||||
class BaseAudioStream(BaseAudio):
|
||||
|
|
@ -40,11 +40,11 @@ class BaseAudioStream(BaseAudio):
|
|||
return self.__unicode__()
|
||||
|
||||
|
||||
class ICapAudioStream(ICapAudio):
|
||||
class CapAudioStream(CapAudio):
|
||||
"""
|
||||
Audio streams provider
|
||||
"""
|
||||
def search_audiostreams(self, pattern, sortby=ICapFile.SEARCH_RELEVANCE):
|
||||
def search_audiostreams(self, pattern, sortby=CapFile.SEARCH_RELEVANCE):
|
||||
"""
|
||||
Search an audio stream
|
||||
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ import re
|
|||
from weboob.tools.compat import basestring, long
|
||||
|
||||
from .base import BaseObject, Field, StringField, DateField, DecimalField, IntField, UserError, Currency
|
||||
from .collection import ICapCollection
|
||||
from .collection import CapCollection
|
||||
|
||||
|
||||
__all__ = ['AccountNotFound', 'TransferError', 'Recipient', 'Account', 'Transaction', 'Investment', 'Transfer', 'ICapBank']
|
||||
__all__ = ['AccountNotFound', 'TransferError', 'Recipient', 'Account', 'Transaction', 'Investment', 'Transfer', 'CapBank']
|
||||
|
||||
|
||||
class AccountNotFound(UserError):
|
||||
|
|
@ -157,7 +157,7 @@ class Transfer(BaseObject):
|
|||
reason = StringField('Reason')
|
||||
|
||||
|
||||
class ICapBank(ICapCollection):
|
||||
class CapBank(CapCollection):
|
||||
"""
|
||||
Capability of bank websites to see accounts and transactions.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@
|
|||
|
||||
|
||||
from .base import BaseObject, StringField, DateField, DecimalField, UserError
|
||||
from .collection import ICapCollection
|
||||
from .collection import CapCollection
|
||||
|
||||
|
||||
__all__ = ['SubscriptionNotFound', 'BillNotFound', 'Detail', 'Bill', 'Subscription', 'ICapBill']
|
||||
__all__ = ['SubscriptionNotFound', 'BillNotFound', 'Detail', 'Bill', 'Subscription', 'CapBill']
|
||||
|
||||
|
||||
class SubscriptionNotFound(UserError):
|
||||
|
|
@ -86,7 +86,7 @@ class Subscription(BaseObject):
|
|||
renewdate = DateField('Reset date of consumption')
|
||||
|
||||
|
||||
class ICapBill(ICapCollection):
|
||||
class CapBill(CapCollection):
|
||||
def iter_resources(self, objs, split_path):
|
||||
"""
|
||||
Iter resources. Will return :func:`iter_subscriptions`.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from .base import IBaseCap, BaseObject, Field, StringField, DateField, \
|
|||
|
||||
|
||||
__all__ = ['IssueError', 'Project', 'User', 'Version', 'Status', 'Attachment',
|
||||
'Change', 'Update', 'Issue', 'Query', 'ICapBugTracker']
|
||||
'Change', 'Update', 'Issue', 'Query', 'CapBugTracker']
|
||||
|
||||
|
||||
class IssueError(UserError):
|
||||
|
|
@ -231,7 +231,7 @@ class Query(BaseObject):
|
|||
BaseObject.__init__(self, '')
|
||||
|
||||
|
||||
class ICapBugTracker(IBaseCap):
|
||||
class CapBugTracker(IBaseCap):
|
||||
"""
|
||||
Bug trackers websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -18,12 +18,12 @@
|
|||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from .base import BaseObject, StringField, DateField, IntField, FloatField, Field
|
||||
from .collection import ICapCollection, CollectionNotFound, Collection
|
||||
from .collection import CapCollection, CollectionNotFound, Collection
|
||||
|
||||
from datetime import time, datetime
|
||||
from weboob.tools.date import parse_date
|
||||
|
||||
__all__ = ['BaseCalendarEvent', 'ICapCalendarEvent']
|
||||
__all__ = ['BaseCalendarEvent', 'CapCalendarEvent']
|
||||
|
||||
|
||||
def enum(**enums):
|
||||
|
|
@ -102,7 +102,7 @@ class Query(BaseObject):
|
|||
self.categories.append(value)
|
||||
|
||||
|
||||
class ICapCalendarEvent(ICapCollection):
|
||||
class CapCalendarEvent(CapCollection):
|
||||
"""
|
||||
Capability of calendar event type sites
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import datetime
|
|||
from .base import IBaseCap, BaseObject, StringField, DateField, UserError
|
||||
|
||||
|
||||
__all__ = ['ChatException', 'ChatMessage', 'ICapChat']
|
||||
__all__ = ['ChatException', 'ChatMessage', 'CapChat']
|
||||
|
||||
|
||||
class ChatException(UserError):
|
||||
|
|
@ -52,7 +52,7 @@ class ChatMessage(BaseObject):
|
|||
self.date = datetime.datetime.utcnow()
|
||||
|
||||
|
||||
class ICapChat(IBaseCap):
|
||||
class CapChat(IBaseCap):
|
||||
"""
|
||||
Websites with a chat system.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, DateField, StringField, IntField, Field
|
||||
|
||||
|
||||
__all__ = ['Movie', 'Person', 'ICapCinema']
|
||||
__all__ = ['Movie', 'Person', 'CapCinema']
|
||||
|
||||
|
||||
class Movie(BaseObject):
|
||||
|
|
@ -68,7 +68,7 @@ class Person(BaseObject):
|
|||
self.name = name
|
||||
|
||||
|
||||
class ICapCinema(IBaseCap):
|
||||
class CapCinema(IBaseCap):
|
||||
"""
|
||||
Cinema databases.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from weboob.tools.ordereddict import OrderedDict
|
|||
from .base import IBaseCap, BaseObject, UserError, StringField, Field
|
||||
|
||||
|
||||
__all__ = ['ICapCollection', 'BaseCollection', 'Collection', 'CollectionNotFound']
|
||||
__all__ = ['CapCollection', 'BaseCollection', 'Collection', 'CollectionNotFound']
|
||||
|
||||
|
||||
class CollectionNotFound(UserError):
|
||||
|
|
@ -95,7 +95,7 @@ class Collection(BaseCollection):
|
|||
return u'Unknown collection'
|
||||
|
||||
|
||||
class ICapCollection(IBaseCap):
|
||||
class CapCollection(IBaseCap):
|
||||
def iter_resources_flat(self, objs, split_path, clean_only=False):
|
||||
"""
|
||||
Call iter_resources() to fetch all resources in the tree.
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from .base import IBaseCap, BaseObject, Field, StringField, BytesField, IntField
|
|||
from weboob.tools.ordereddict import OrderedDict
|
||||
|
||||
|
||||
__all__ = ['ProfileNode', 'ContactPhoto', 'Contact', 'QueryError', 'Query', 'ICapContact']
|
||||
__all__ = ['ProfileNode', 'ContactPhoto', 'Contact', 'QueryError', 'Query', 'CapContact']
|
||||
|
||||
|
||||
class ProfileNode(object):
|
||||
|
|
@ -165,7 +165,7 @@ class Query(BaseObject):
|
|||
self.message = message
|
||||
|
||||
|
||||
class ICapContact(IBaseCap):
|
||||
class CapContact(IBaseCap):
|
||||
def iter_contacts(self, status=Contact.STATUS_ALL, ids=None):
|
||||
"""
|
||||
Iter contacts
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, StringField, DateField, Field
|
||||
|
||||
|
||||
__all__ = ['Content', 'Revision', 'ICapContent']
|
||||
__all__ = ['Content', 'Revision', 'CapContent']
|
||||
|
||||
|
||||
class Content(BaseObject):
|
||||
|
|
@ -44,7 +44,7 @@ class Revision(BaseObject):
|
|||
minor = Field('Is this change minor?', bool)
|
||||
|
||||
|
||||
class ICapContent(IBaseCap):
|
||||
class CapContent(IBaseCap):
|
||||
def get_content(self, id, revision=None):
|
||||
"""
|
||||
Get a content from an ID.
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from .base import IBaseCap, BaseObject, Field, StringField, DateField, UserError
|
|||
from .contact import Contact
|
||||
|
||||
|
||||
__all__ = ['OptimizationNotFound', 'Optimization', 'Event', 'ICapDating']
|
||||
__all__ = ['OptimizationNotFound', 'Optimization', 'Event', 'CapDating']
|
||||
|
||||
|
||||
class OptimizationNotFound(UserError):
|
||||
|
|
@ -89,7 +89,7 @@ class Event(BaseObject):
|
|||
message = StringField('Message of the event')
|
||||
|
||||
|
||||
class ICapDating(IBaseCap):
|
||||
class CapDating(IBaseCap):
|
||||
"""
|
||||
Capability for dating websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, NotAvailable, Field, StringField, DateField
|
||||
|
||||
|
||||
__all__ = ['BaseFile', 'ICapFile']
|
||||
__all__ = ['BaseFile', 'CapFile']
|
||||
|
||||
|
||||
class BaseFile(BaseObject):
|
||||
|
|
@ -59,7 +59,7 @@ class BaseFile(BaseObject):
|
|||
return self.id2url(self.id)
|
||||
|
||||
|
||||
class ICapFile(IBaseCap):
|
||||
class CapFile(IBaseCap):
|
||||
"""
|
||||
Provide file download
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from weboob.tools.capabilities.thumbnail import Thumbnail
|
|||
from .base import IBaseCap, BaseObject, NotLoaded, Field, StringField, \
|
||||
BytesField, IntField, FloatField, DateField
|
||||
|
||||
__all__ = ['BaseGallery', 'BaseImage', 'ICapGallery']
|
||||
__all__ = ['BaseGallery', 'BaseImage', 'CapGallery']
|
||||
|
||||
|
||||
class BaseGallery(BaseObject):
|
||||
|
|
@ -102,7 +102,7 @@ class BaseImage(BaseObject):
|
|||
return self.data is not NotLoaded
|
||||
|
||||
|
||||
class ICapGallery(IBaseCap):
|
||||
class CapGallery(IBaseCap):
|
||||
"""
|
||||
This capability represents the ability for a website backend to provide videos.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
from .base import IBaseCap, BaseObject, StringField, FloatField, DateField, Field, UserError, empty
|
||||
|
||||
__all__ = ['Gauge', 'GaugeSensor', 'GaugeMeasure', 'ICapGauge', 'SensorNotFound']
|
||||
__all__ = ['Gauge', 'GaugeSensor', 'GaugeMeasure', 'CapGauge', 'SensorNotFound']
|
||||
|
||||
|
||||
class SensorNotFound(UserError):
|
||||
|
|
@ -73,7 +73,7 @@ class GaugeSensor(BaseObject):
|
|||
return "<GaugeSensor id=%s name=%s>" % (self.id, self.name)
|
||||
|
||||
|
||||
class ICapGauge(IBaseCap):
|
||||
class CapGauge(IBaseCap):
|
||||
def iter_gauges(self, pattern=None):
|
||||
"""
|
||||
Iter gauges.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, StringField, FloatField
|
||||
|
||||
|
||||
__all__ = ['IpLocation', 'ICapGeolocIp']
|
||||
__all__ = ['IpLocation', 'CapGeolocIp']
|
||||
|
||||
|
||||
class IpLocation(BaseObject):
|
||||
|
|
@ -42,7 +42,7 @@ class IpLocation(BaseObject):
|
|||
BaseObject.__init__(self, ipaddr)
|
||||
|
||||
|
||||
class ICapGeolocIp(IBaseCap):
|
||||
class CapGeolocIp(IBaseCap):
|
||||
"""
|
||||
Access information about IP addresses database.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from .base import IBaseCap, BaseObject, Field, IntField, DecimalField, \
|
|||
StringField, BytesField, DateField
|
||||
|
||||
|
||||
__all__ = ['HousingPhoto', 'Housing', 'Query', 'City', 'ICapHousing']
|
||||
__all__ = ['HousingPhoto', 'Housing', 'Query', 'City', 'CapHousing']
|
||||
|
||||
|
||||
class HousingPhoto(BaseObject):
|
||||
|
|
@ -89,7 +89,7 @@ class City(BaseObject):
|
|||
name = StringField('Name of city')
|
||||
|
||||
|
||||
class ICapHousing(IBaseCap):
|
||||
class CapHousing(IBaseCap):
|
||||
"""
|
||||
Capability of websites to search housings.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@
|
|||
|
||||
from weboob.tools.ordereddict import OrderedDict
|
||||
from .base import NotLoaded, Field, BytesField
|
||||
from .file import ICapFile, BaseFile
|
||||
from .file import CapFile, BaseFile
|
||||
|
||||
__all__ = ['BaseImage', 'ICapImage']
|
||||
__all__ = ['BaseImage', 'CapImage']
|
||||
|
||||
class _BaseImage(BaseFile):
|
||||
"""
|
||||
|
|
@ -57,11 +57,11 @@ class BaseImage(_BaseImage):
|
|||
return OrderedDict(iter_decorate(fields_iterator))
|
||||
|
||||
|
||||
class ICapImage(ICapFile):
|
||||
class CapImage(CapFile):
|
||||
"""
|
||||
Image file provider
|
||||
"""
|
||||
def search_image(self, pattern, sortby=ICapFile.SEARCH_RELEVANCE, nsfw=False):
|
||||
def search_image(self, pattern, sortby=CapFile.SEARCH_RELEVANCE, nsfw=False):
|
||||
"""
|
||||
search for an image file
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
from .base import BaseObject, IBaseCap, StringField, DateField
|
||||
|
||||
__all__ = ['BaseJobAdvert', 'ICapJob']
|
||||
__all__ = ['BaseJobAdvert', 'CapJob']
|
||||
|
||||
|
||||
class BaseJobAdvert(BaseObject):
|
||||
|
|
@ -67,7 +67,7 @@ class BaseJobAdvert(BaseObject):
|
|||
return self.id2url(self.id)
|
||||
|
||||
|
||||
class ICapJob(IBaseCap):
|
||||
class CapJob(IBaseCap):
|
||||
"""
|
||||
Capability of job annouce websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@
|
|||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from .collection import ICapCollection
|
||||
from .collection import CapCollection
|
||||
from .base import BaseObject, Field, StringField, DateField
|
||||
|
||||
|
||||
__all__ = ['Book', 'Renew', 'ICapBook']
|
||||
__all__ = ['Book', 'Renew', 'CapBook']
|
||||
|
||||
|
||||
class Book(BaseObject):
|
||||
|
|
@ -42,7 +42,7 @@ class Renew(BaseObject):
|
|||
message = StringField('Message')
|
||||
|
||||
|
||||
class ICapBook(ICapCollection):
|
||||
class CapBook(CapCollection):
|
||||
"""
|
||||
Library websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, StringField
|
||||
|
||||
|
||||
__all__ = ['SongLyrics', 'ICapLyrics']
|
||||
__all__ = ['SongLyrics', 'CapLyrics']
|
||||
|
||||
|
||||
class SongLyrics(BaseObject):
|
||||
|
|
@ -37,7 +37,7 @@ class SongLyrics(BaseObject):
|
|||
self.title = title
|
||||
|
||||
|
||||
class ICapLyrics(IBaseCap):
|
||||
class CapLyrics(IBaseCap):
|
||||
"""
|
||||
Lyrics websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from .base import IBaseCap, BaseObject, NotLoaded, Field, StringField, \
|
|||
DateField, IntField, UserError
|
||||
|
||||
|
||||
__all__ = ['Thread', 'Message', 'ICapMessages', 'CantSendMessage', 'ICapMessagesPost']
|
||||
__all__ = ['Thread', 'Message', 'CapMessages', 'CantSendMessage', 'CapMessagesPost']
|
||||
|
||||
|
||||
# Message and Thread's attributes refer to themselves, and it isn't possible
|
||||
|
|
@ -165,7 +165,7 @@ class Thread(_Thread):
|
|||
yield m
|
||||
|
||||
|
||||
class ICapMessages(IBaseCap):
|
||||
class CapMessages(IBaseCap):
|
||||
"""
|
||||
Capability to read messages.
|
||||
"""
|
||||
|
|
@ -209,7 +209,7 @@ class CantSendMessage(UserError):
|
|||
"""
|
||||
|
||||
|
||||
class ICapMessagesPost(IBaseCap):
|
||||
class CapMessagesPost(IBaseCap):
|
||||
"""
|
||||
This capability allow user to send a message.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class Parcel(BaseObject):
|
|||
history = Field('History', list)
|
||||
|
||||
|
||||
class ICapParcel(IBaseCap):
|
||||
class CapParcel(IBaseCap):
|
||||
def get_parcel_tracking(self, id):
|
||||
"""
|
||||
Get information abouut a parcel.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, NotLoaded, Field, StringField, UserError
|
||||
|
||||
|
||||
__all__ = ['PasteNotFound', 'BasePaste', 'ICapPaste']
|
||||
__all__ = ['PasteNotFound', 'BasePaste', 'CapPaste']
|
||||
|
||||
|
||||
class PasteNotFound(UserError):
|
||||
|
|
@ -63,7 +63,7 @@ class BasePaste(BaseObject):
|
|||
return self.id2url(self.id)
|
||||
|
||||
|
||||
class ICapPaste(IBaseCap):
|
||||
class CapPaste(IBaseCap):
|
||||
"""
|
||||
This capability represents the ability for a website backend to store plain text.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from .base import IBaseCap, BaseObject, Field, DecimalField, \
|
|||
StringField, DateField
|
||||
|
||||
|
||||
__all__ = ['Shop', 'Price', 'Product', 'ICapPriceComparison']
|
||||
__all__ = ['Shop', 'Price', 'Product', 'CapPriceComparison']
|
||||
|
||||
|
||||
class Product(BaseObject):
|
||||
|
|
@ -53,7 +53,7 @@ class Price(BaseObject):
|
|||
product = Field('Product', Product)
|
||||
|
||||
|
||||
class ICapPriceComparison(IBaseCap):
|
||||
class CapPriceComparison(IBaseCap):
|
||||
"""
|
||||
Capability for price comparison websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from .base import IBaseCap, BaseObject, Field, StringField
|
|||
from weboob.tools.capabilities.streaminfo import StreamInfo
|
||||
|
||||
|
||||
__all__ = ['Radio', 'ICapRadio']
|
||||
__all__ = ['Radio', 'CapRadio']
|
||||
|
||||
|
||||
class Radio(BaseObject):
|
||||
|
|
@ -35,7 +35,7 @@ class Radio(BaseObject):
|
|||
current = Field('Current emission', StreamInfo)
|
||||
streams = Field('List of streams', list)
|
||||
|
||||
class ICapRadio(IBaseCap):
|
||||
class CapRadio(IBaseCap):
|
||||
"""
|
||||
Capability of radio websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ import re
|
|||
import urllib
|
||||
|
||||
|
||||
__all__ = ['Recipe', 'ICapRecipe']
|
||||
__all__ = ['Recipe', 'CapRecipe']
|
||||
|
||||
|
||||
class Comment():
|
||||
|
|
@ -161,7 +161,7 @@ class Recipe(BaseObject):
|
|||
return header + ET.tostring(doc, encoding='UTF-8', pretty_print=True).decode('utf-8')
|
||||
|
||||
|
||||
class ICapRecipe(IBaseCap):
|
||||
class CapRecipe(IBaseCap):
|
||||
"""
|
||||
Recipe providers.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, StringField, IntField, UserError
|
||||
|
||||
|
||||
__all__ = ['Subtitle', 'ICapSubtitle']
|
||||
__all__ = ['Subtitle', 'CapSubtitle']
|
||||
|
||||
|
||||
class LanguageNotSupported(UserError):
|
||||
|
|
@ -48,7 +48,7 @@ class Subtitle(BaseObject):
|
|||
BaseObject.__init__(self, id)
|
||||
self.name = name
|
||||
|
||||
class ICapSubtitle(IBaseCap):
|
||||
class CapSubtitle(IBaseCap):
|
||||
"""
|
||||
Subtitle providers.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from .base import IBaseCap, BaseObject, Field, StringField, FloatField, \
|
|||
DateField, IntField, UserError
|
||||
|
||||
|
||||
__all__ = ['MagnetOnly', 'Torrent', 'ICapTorrent']
|
||||
__all__ = ['MagnetOnly', 'Torrent', 'CapTorrent']
|
||||
|
||||
|
||||
class MagnetOnly(UserError):
|
||||
|
|
@ -54,7 +54,7 @@ class Torrent(BaseObject):
|
|||
self.name = name
|
||||
|
||||
|
||||
class ICapTorrent(IBaseCap):
|
||||
class CapTorrent(IBaseCap):
|
||||
"""
|
||||
Torrent trackers.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
from .base import IBaseCap, BaseObject, StringField, UserError
|
||||
|
||||
|
||||
__all__ = ['TranslationFail', 'LanguageNotSupported', 'ICapTranslate']
|
||||
__all__ = ['TranslationFail', 'LanguageNotSupported', 'CapTranslate']
|
||||
|
||||
|
||||
class LanguageNotSupported(UserError):
|
||||
|
|
@ -51,7 +51,7 @@ class Translation(BaseObject):
|
|||
text = StringField('Translation')
|
||||
|
||||
|
||||
class ICapTranslate(IBaseCap):
|
||||
class CapTranslate(IBaseCap):
|
||||
"""
|
||||
Capability of online translation website to translate word or sentence
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from .base import IBaseCap, BaseObject, StringField, TimeField, DeltaField, \
|
|||
DateField, DecimalField, UserError
|
||||
|
||||
|
||||
__all__ = ['Station', 'Departure', 'RoadStep', 'RoadmapError', 'RoadmapFilters', 'ICapTravel']
|
||||
__all__ = ['Station', 'Departure', 'RoadStep', 'RoadmapError', 'RoadmapFilters', 'CapTravel']
|
||||
|
||||
|
||||
class Station(BaseObject):
|
||||
|
|
@ -96,7 +96,7 @@ class RoadmapFilters(BaseObject):
|
|||
BaseObject.__init__(self, '')
|
||||
|
||||
|
||||
class ICapTravel(IBaseCap):
|
||||
class CapTravel(IBaseCap):
|
||||
"""
|
||||
Travel websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -21,10 +21,10 @@
|
|||
from datetime import timedelta
|
||||
|
||||
from .base import Field
|
||||
from .image import ICapImage, BaseImage
|
||||
from .image import CapImage, BaseImage
|
||||
|
||||
|
||||
__all__ = ['BaseVideo', 'ICapVideo']
|
||||
__all__ = ['BaseVideo', 'CapVideo']
|
||||
|
||||
|
||||
class BaseVideo(BaseImage):
|
||||
|
|
@ -36,12 +36,12 @@ class BaseVideo(BaseImage):
|
|||
duration = Field('file duration', int, long, timedelta)
|
||||
|
||||
|
||||
class ICapVideo(ICapImage):
|
||||
class CapVideo(CapImage):
|
||||
"""
|
||||
Video file provider.
|
||||
"""
|
||||
|
||||
def search_videos(self, pattern, sortby=ICapImage.SEARCH_RELEVANCE, nsfw=False):
|
||||
def search_videos(self, pattern, sortby=CapImage.SEARCH_RELEVANCE, nsfw=False):
|
||||
"""
|
||||
search for a video file
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from .base import IBaseCap, BaseObject, Field, DateField, FloatField, \
|
|||
StringField, UserError
|
||||
|
||||
|
||||
__all__ = ['Forecast', 'Current', 'City', 'CityNotFound', 'Temperature', 'ICapWeather']
|
||||
__all__ = ['Forecast', 'Current', 'City', 'CityNotFound', 'Temperature', 'CapWeather']
|
||||
|
||||
|
||||
class Temperature(BaseObject):
|
||||
|
|
@ -109,7 +109,7 @@ class CityNotFound(UserError):
|
|||
"""
|
||||
|
||||
|
||||
class ICapWeather(IBaseCap):
|
||||
class CapWeather(IBaseCap):
|
||||
"""
|
||||
Capability for weather websites.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ class Weboob(WebNip):
|
|||
Load backends listed in config file.
|
||||
|
||||
:param caps: load backends which implement all of specified caps
|
||||
:type caps: tuple[:class:`weboob.capabilities.base.ICapBase`]
|
||||
:type caps: tuple[:class:`weboob.capabilities.base.CapBase`]
|
||||
:param names: load backends with instance name in list
|
||||
:type names: tuple[:class:`str`]
|
||||
:param modules: load backends which module is in list
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ from tempfile import NamedTemporaryFile
|
|||
from ssl import SSLError
|
||||
|
||||
from weboob.capabilities import UserError
|
||||
from weboob.capabilities.account import ICapAccount, Account, AccountRegisterError
|
||||
from weboob.capabilities.account import CapAccount, Account, AccountRegisterError
|
||||
from weboob.core.backendscfg import BackendAlreadyExists
|
||||
from weboob.core.modules import ModuleLoadError
|
||||
from weboob.core.repositories import ModuleInstallError
|
||||
|
|
@ -238,7 +238,7 @@ class ConsoleApplication(BaseApplication):
|
|||
print('Backend "%s" does not exist.' % name, file=sys.stderr)
|
||||
return 1
|
||||
|
||||
if not backend.has_caps(ICapAccount) or backend.klass.ACCOUNT_REGISTER_PROPERTIES is None:
|
||||
if not backend.has_caps(CapAccount) or backend.klass.ACCOUNT_REGISTER_PROPERTIES is None:
|
||||
print('You can\'t register a new account with %s' % name, file=sys.stderr)
|
||||
return 1
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ from logging import warning
|
|||
from weboob.core.modules import ModuleLoadError
|
||||
from weboob.core.repositories import IProgress, ModuleInstallError
|
||||
from weboob.core.backendscfg import BackendAlreadyExists
|
||||
from weboob.capabilities.account import ICapAccount, Account, AccountRegisterError
|
||||
from weboob.capabilities.account import CapAccount, Account, AccountRegisterError
|
||||
from weboob.tools.application.qt.backendcfg_ui import Ui_BackendCfg
|
||||
from weboob.tools.application.qt.reposdlg_ui import Ui_RepositoriesDlg
|
||||
from weboob.tools.ordereddict import OrderedDict
|
||||
|
|
@ -378,9 +378,9 @@ class BackendCfg(QDialog):
|
|||
module.license,
|
||||
(unicode(self.tr('<b>Website</b>: %s<br />')) % module.website) if module.website else '',
|
||||
module.description,
|
||||
', '.join(sorted(cap.__name__.replace('ICap', '') for cap in module.iter_caps()))))
|
||||
', '.join(sorted(cap.__name__.replace('Cap', '') for cap in module.iter_caps()))))
|
||||
|
||||
if module.has_caps(ICapAccount) and self.ui.nameEdit.isEnabled() and \
|
||||
if module.has_caps(CapAccount) and self.ui.nameEdit.isEnabled() and \
|
||||
module.klass.ACCOUNT_REGISTER_PROPERTIES is not None:
|
||||
self.ui.registerButton.show()
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ from weboob.tools.application.formatters.iformatter import MandatoryFieldsNotFou
|
|||
from weboob.tools.misc import to_unicode
|
||||
from weboob.tools.path import WorkingPath
|
||||
from weboob.tools.ordereddict import OrderedDict
|
||||
from weboob.capabilities.collection import Collection, BaseCollection, ICapCollection, CollectionNotFound
|
||||
from weboob.capabilities.collection import Collection, BaseCollection, CapCollection, CollectionNotFound
|
||||
|
||||
from .console import BackendNotGiven, ConsoleApplication
|
||||
from .formatters.load import FormattersLoader, FormatterLoadError
|
||||
|
|
@ -1102,7 +1102,7 @@ class ReplApplication(Cmd, ConsoleApplication):
|
|||
try:
|
||||
for backend, res in self.do('get_collection', objs=self.COLLECTION_OBJECTS,
|
||||
split_path=self.working_path.get(),
|
||||
caps=ICapCollection):
|
||||
caps=CapCollection):
|
||||
if res:
|
||||
collections.append(res)
|
||||
except CallErrors as errors:
|
||||
|
|
@ -1125,7 +1125,7 @@ class ReplApplication(Cmd, ConsoleApplication):
|
|||
try:
|
||||
for backend, res in self.do('iter_resources', objs=objs,
|
||||
split_path=split_path,
|
||||
caps=ICapCollection):
|
||||
caps=CapCollection):
|
||||
yield res
|
||||
except CallErrors as errors:
|
||||
self.bcall_errors_handler(errors, CollectionNotFound)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
import re
|
||||
|
||||
from weboob.capabilities.gallery import ICapGallery, BaseGallery, BaseImage
|
||||
from weboob.capabilities.gallery import CapGallery, BaseGallery, BaseImage
|
||||
from weboob.tools.backend import BaseBackend
|
||||
from weboob.tools.browser import BaseBrowser, BasePage
|
||||
|
||||
|
|
@ -63,7 +63,7 @@ class GenericComicReaderBrowser(BaseBrowser):
|
|||
image.data = self.readurl(image.url)
|
||||
|
||||
|
||||
class GenericComicReaderBackend(BaseBackend, ICapGallery):
|
||||
class GenericComicReaderBackend(BaseBackend, CapGallery):
|
||||
NAME = 'genericcomicreader'
|
||||
MAINTAINER = u'Noé Rubinstein'
|
||||
EMAIL = 'noe.rubinstein@gmail.com'
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@
|
|||
|
||||
|
||||
import time
|
||||
from weboob.capabilities.messages import ICapMessages, Message, Thread
|
||||
from weboob.capabilities.messages import CapMessages, Message, Thread
|
||||
from weboob.capabilities.base import find_object
|
||||
from weboob.tools.backend import BaseBackend
|
||||
from weboob.tools.newsfeed import Newsfeed
|
||||
|
||||
|
||||
class GenericNewspaperBackend(BaseBackend, ICapMessages):
|
||||
class GenericNewspaperBackend(BaseBackend, CapMessages):
|
||||
"""
|
||||
GenericNewspaperBackend class
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@
|
|||
|
||||
|
||||
|
||||
from weboob.capabilities.paste import ICapPaste
|
||||
from weboob.capabilities.paste import CapPaste
|
||||
import binascii
|
||||
|
||||
|
||||
class BasePasteBackend(ICapPaste):
|
||||
class BasePasteBackend(CapPaste):
|
||||
EXPIRATIONS = {}
|
||||
"""
|
||||
List of expirations and their corresponding remote codes (any type can be used).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue