rename ICap to Cap (closes #1424)

This commit is contained in:
Romain Bignon 2014-07-05 17:33:44 +02:00
commit e025fb0b20
244 changed files with 679 additions and 679 deletions

View file

@ -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)."

View file

@ -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]'

View file

@ -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,

View file

@ -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,
}

View file

@ -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,
}

View file

@ -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

View file

@ -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"

View file

@ -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)

View file

@ -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,
}

View file

@ -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)

View file

@ -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):
"""

View file

@ -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
}

View file

@ -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,
}

View file

@ -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, )

View file

@ -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:

View file

@ -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,
}

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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,

View file

@ -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()

View file

@ -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()

View file

@ -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

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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):

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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')),

View file

@ -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())

View file

@ -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()

View file

@ -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)

View file

@ -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()

View file

@ -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)

View file

@ -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()

View file

@ -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()

View file

@ -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)

View file

@ -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
}

View file

@ -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,
}

View file

@ -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,

View file

@ -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',

View file

@ -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):
"""

View file

@ -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

View file

@ -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,
}

View file

@ -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)