Add missing "whatis entry" to man pages

This is recommended by Debian.
closes #618
This commit is contained in:
Laurent Bachelier 2013-02-13 00:38:33 +01:00
commit ae06ae3384
64 changed files with 284 additions and 213 deletions

View file

@ -159,6 +159,7 @@ class Boobank(ReplApplication):
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)."
SHORT_DESCRIPTION = "manage bank accounts"
EXTRA_FORMATTERS = {'account_list': AccountListFormatter,
'recipient_list': RecipientListFormatter,
'transfer': TransferFormatter,

View file

@ -277,6 +277,7 @@ class Boobathon(ReplApplication):
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2011 Romain Bignon'
DESCRIPTION = 'Console application to participate to a Boobathon.'
SHORT_DESCRIPTION = "participate in a Boobathon"
CAPS = ICapContent
SYNOPSIS = 'Usage: %prog [-dqv] [-b backends] [-cnfs] boobathon\n'
SYNOPSIS += ' %prog [--help] [--version]'

View file

@ -43,6 +43,7 @@ class Boobill(ReplApplication):
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2012 Florent Fourcot'
DESCRIPTION = 'Console application allowing to get and download bills.'
SHORT_DESCRIPTION = "get and download bills"
CAPS = ICapBill
COLLECTION_OBJECTS = (Subscription, )
EXTRA_FORMATTERS = {'subscriptions': SubscriptionsFormatter,

View file

@ -271,6 +271,7 @@ class Boobmsg(ReplApplication):
COPYRIGHT = 'Copyright(C) 2010-2011 Christophe Benz'
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
EXTRA_FORMATTERS = {'msglist': MessagesListFormatter,
'msg': MessageFormatter,

View file

@ -28,7 +28,7 @@ __all__ = ['Boobooks']
class RentedListFormatter(PrettyFormatter):
MANDATORY_FIELDS = ('id', 'date', 'author', 'name', 'late')
RED = ''
RED = ''
def get_title(self, obj):
s = u'%s%s (%s)' % (obj.author, obj.name, obj.date)
@ -36,6 +36,7 @@ class RentedListFormatter(PrettyFormatter):
s += u' %sLATE!%s' % (self.RED, self.NC)
return s
class Boobooks(ReplApplication):
APPNAME = 'boobooks'
VERSION = '0.f'
@ -43,6 +44,7 @@ class Boobooks(ReplApplication):
CAPS = ICapBook
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"
EXTRA_FORMATTERS = {'rented_list': RentedListFormatter,
}
DEFAULT_FORMATTER = 'table'

View file

@ -59,6 +59,7 @@ class IssueFormatter(IFormatter):
result += html2text(u.message)
return result
class IssuesListFormatter(PrettyFormatter):
MANDATORY_FIELDS = ('id', 'project', 'status', 'title', 'category')
@ -73,8 +74,8 @@ class BoobTracker(ReplApplication):
APPNAME = 'boobtracker'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2011 Romain Bignon'
DESCRIPTION = "Console application allowing to send messages on various websites and " \
"to display message threads and contents."
DESCRIPTION = "Console application allowing to create, edit, view bug tracking issues."
SHORT_DESCRIPTION = "manage bug tracking issues"
CAPS = ICapBugTracker
EXTRA_FORMATTERS = {'issue_info': IssueFormatter,
'issues_list': IssuesListFormatter,
@ -151,7 +152,7 @@ class BoobTracker(ReplApplication):
issue = self.get_object(line, 'get_issue')
if not issue:
print >>sys.stderr, 'Issue not found: %s' % line
print >>sys.stderr, 'Issue not found: %s' % line
return 3
self.format(issue)
self.flush()
@ -335,7 +336,7 @@ class BoobTracker(ReplApplication):
_id, key, value = self.parse_command_args(line, 3, 1)
issue = self.get_object(_id, 'get_issue')
if not issue:
print >>sys.stderr, 'Issue not found: %s' % _id
print >>sys.stderr, 'Issue not found: %s' % _id
return 3
self.prompt_issue(issue, key, value)

View file

@ -79,7 +79,8 @@ class Comparoob(ReplApplication):
APPNAME = 'comparoob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2012 Romain Bignon'
DESCRIPTION = 'Console application to compare products.'
DESCRIPTION = "Console application to compare products."
SHORT_DESCRIPTION = "compare products"
DEFAULT_FORMATTER = 'table'
EXTRA_FORMATTERS = {'prices': PricesFormatter,
'price': PriceFormatter,
@ -141,7 +142,7 @@ class Comparoob(ReplApplication):
price = self.get_object(_id, 'get_price')
if not price:
print >>sys.stderr, 'Price not found: %s' % _id
print >>sys.stderr, 'Price not found: %s' % _id
return 3
self.start_format()

View file

@ -58,6 +58,7 @@ class HousingFormatter(IFormatter):
result += ' %s: %s\n' % (key, value)
return result
class HousingListFormatter(PrettyFormatter):
MANDATORY_FIELDS = ('id', 'title', 'cost', 'text')
@ -76,7 +77,8 @@ class Flatboob(ReplApplication):
APPNAME = 'flatboob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2012 Romain Bignon'
DESCRIPTION = 'Console application to search a house.'
DESCRIPTION = "Console application to search for housing."
SHORT_DESCRIPTION = "search for housing"
CAPS = ICapHousing
EXTRA_FORMATTERS = {'housing_list': HousingListFormatter,
'housing': HousingFormatter,
@ -160,7 +162,7 @@ class Flatboob(ReplApplication):
housing = self.get_object(_id, 'get_housing')
if not housing:
print >>sys.stderr, 'Housing not found: %s' % _id
print >>sys.stderr, 'Housing not found: %s' % _id
return 3
self.start_format()

View file

@ -51,6 +51,7 @@ class Galleroob(ReplApplication):
VERSION = '0.f'
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
EXTRA_FORMATTERS = {'gallery_list': GalleryListFormatter}
COMMANDS_FORMATTERS = {'search': 'gallery_list', 'ls': 'gallery_list'}

View file

@ -31,7 +31,8 @@ class Geolooc(ReplApplication):
APPNAME = 'geolooc'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = 'Console application allowing to geolocalize IP addresses.'
DESCRIPTION = "Console application allowing to geolocalize IP addresses."
SHORT_DESCRIPTION = "geolocalize IP addresses"
CAPS = ICapGeolocIp
def main(self, argv):

View file

@ -45,12 +45,14 @@ class EventListFormatter(PrettyFormatter):
if hasattr(event, 'message'):
return event.message
class HaveDate(Boobmsg):
APPNAME = 'havedate'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2012 Romain Bignon'
DESCRIPTION = 'Console application allowing to interact with various dating websites ' \
'and to optimize seduction algorithmically.'
DESCRIPTION = "Console application allowing to interact with various dating websites " \
"and to optimize seduction algorithmically."
SHORT_DESCRIPTION = "interact with dating websites"
STORAGE_FILENAME = 'dating.storage'
STORAGE = {'optims': {}}
CAPS = ICapDating

View file

@ -281,6 +281,8 @@ class Masstransit(BaseApplication):
APPNAME = 'masstransit'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Julien Hébert'
DESCRIPTION = "Maemo application allowing to search for train stations and get departure times."
SHORT_DESCRIPTION = "search for train stations and departures"
def main(self, argv):
self.load_backends(ICapTravel)

View file

@ -41,6 +41,7 @@ from weboob.tools.misc import html2text, get_backtrace, utc2local, to_unicode
__all__ = ['Monboob']
class FakeSMTPD(SMTPServer):
def __init__(self, app, bindaddr, port):
SMTPServer.__init__(self, (bindaddr, port), None)
@ -50,6 +51,7 @@ class FakeSMTPD(SMTPServer):
msg = message_from_string(data)
self.app.process_incoming_mail(msg)
class MonboobScheduler(Scheduler):
def __init__(self, app):
Scheduler.__init__(self)
@ -89,6 +91,7 @@ class Monboob(ReplApplication):
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = 'Daemon allowing to regularly check for new messages on various websites, ' \
'and send an email for each message, and post a reply to a message on a website.'
SHORT_DESCRIPTION = "daemon to send and check messages"
CONFIG = {'interval': 300,
'domain': 'weboob.example.org',
'recipient': 'weboob@example.org',
@ -119,7 +122,7 @@ class Monboob(ReplApplication):
try:
self.config.set('html', int(self.config.get('html')))
if self.config.get('html') not in (0,1):
if self.config.get('html') not in (0, 1):
raise ValueError()
except ValueError:
print >>sys.stderr, 'Configuration error: html must be 0 or 1.'

View file

@ -37,8 +37,9 @@ __all__ = ['Pastoob']
class Pastoob(ReplApplication):
APPNAME = 'pastoob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2011 Laurent Bachelier'
DESCRIPTION = 'Console application allowing to post and get pastes from pastebins.'
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
def main(self, argv):

View file

@ -23,11 +23,13 @@ from weboob.tools.application.qt import QtApplication
from .main_window import MainWindow
class QBoobMsg(QtApplication):
APPNAME = 'qboobmsg'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = 'Qt application allowing to read messages on various websites and reply to them.'
DESCRIPTION = "Qt application allowing to read messages on various websites and reply to them."
SHORT_DESCRIPTION = "send and receive message threads"
CAPS = ICapMessages
def main(self, argv):

View file

@ -24,11 +24,13 @@ from weboob.tools.config.yamlconfig import YamlConfig
from .main_window import MainWindow
class QFlatBoob(QtApplication):
APPNAME = 'qflatboob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2012 Romain Bignon'
DESCRIPTION = 'Qt application to find housings.'
DESCRIPTION = "Qt application to search for housing."
SHORT_DESCRIPTION = "search for housing"
CAPS = ICapHousing
CONFIG = {'queries': {}}
STORAGE = {'bookmarks': [], 'read': [], 'notes': {}}

View file

@ -27,7 +27,8 @@ class QHaveDate(QtApplication):
APPNAME = 'qhavedate'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2012 Romain Bignon'
DESCRIPTION = 'Qt application allowing to interact with various dating websites.'
DESCRIPTION = "Qt application allowing to interact with various dating websites."
SHORT_DESCRIPTION = "interact with dating websites"
CAPS = ICapDating
STORAGE_FILENAME = 'dating.storage'

View file

@ -23,11 +23,13 @@ from weboob.tools.application.qt import QtApplication
from .main_window import MainWindow
class QVideoob(QtApplication):
APPNAME = 'qvideoob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = 'Qt application allowing to search videos on various websites and play them.'
DESCRIPTION = "Qt application allowing to search videos on various websites and play them."
SHORT_DESCRIPTION = "search and play videos"
CAPS = ICapVideo
CONFIG = {'settings': {'nsfw': 1,
'sfw': 1,

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
from PyQt4.QtCore import QUrl
from PyQt4.QtCore import QUrl
from PyQt4.QtGui import QDialog
from PyQt4.phonon import Phonon

View file

@ -27,7 +27,8 @@ class QWebContentEdit(QtApplication):
APPNAME = 'qwebcontentedit'
VERSION = '0.f'
COPYRIGHT = u'Copyright(C) 2011 Clément Schreiner'
DESCRIPTION = 'Qt application allowing to manage contents of various websites.'
DESCRIPTION = "Qt application allowing to manage content of various websites."
SHORT_DESCRIPTION = "manage websites content"
CAPS = ICapContent
def main(self, argv):

View file

@ -28,6 +28,7 @@ class QWeboobCfg(QtApplication):
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = "weboob-config-qt is a graphical application to add/edit/remove backends, " \
"and to register new website accounts."
SHORT_DESCRIPTION = "manage backends or register new accounts"
def main(self, argv):
self.load_backends()

View file

@ -33,7 +33,6 @@ __all__ = ['Radioob']
class RadioListFormatter(PrettyFormatter):
MANDATORY_FIELDS = ('id', 'title', 'description')
def get_title(self, obj):
return obj.title
@ -51,8 +50,9 @@ class Radioob(ReplApplication):
APPNAME = 'radioob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2012 Romain Bignon'
DESCRIPTION = 'Console application allowing to search for web radio stations, listen to them and get information ' \
'like the current song.'
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
EXTRA_FORMATTERS = {'radio_list': RadioListFormatter}
COMMANDS_FORMATTERS = {'ls': 'radio_list',

View file

@ -33,6 +33,7 @@ class TranslationFormatter(IFormatter):
def format_obj(self, obj, alias):
return u'%s* %s%s\n\t%s' % (self.BOLD, obj.backend, self.NC, obj.text.replace('\n', '\n\t'))
class XmlTranslationFormatter(IFormatter):
MANDATORY_FIELDS = ('id', 'text')
@ -43,11 +44,13 @@ class XmlTranslationFormatter(IFormatter):
def format_obj(self, obj, alias):
return u'<translation %s>\n%s\n</translation>' % (obj.backend, obj.text)
class Translaboob(ReplApplication):
APPNAME = 'translaboob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2012 Lucien Loiseau'
DESCRIPTION = 'Console application to translate text from one language to another'
DESCRIPTION = "Console application to translate text from one language to another"
SHORT_DESCRIPTION = "translate text from one language to another"
CAPS = ICapTranslate
EXTRA_FORMATTERS = {'translation': TranslationFormatter,
'xmltrans': XmlTranslationFormatter,
@ -55,19 +58,18 @@ class Translaboob(ReplApplication):
COMMANDS_FORMATTERS = {'translate': 'translation',
}
LANGUAGE = {
'ar':'Arabic', 'af':'Afrikaans', 'sq':'Albanian', 'hy':'Armenian', 'az':'Azerbaijani', 'eu':'Basque', 'be':'Belarusian',
'bn':'Bengali', 'bg':'Bulgarian', 'ca':'Catalan', 'zh':'Chinese', 'hr':'Croatian', 'cz':'Czech', 'da':'Danish',
'nl':'Dutch', 'en':'English', 'eo':'Esperanto', 'et':'Estonian', 'tl':'Filipino', 'fi':'Finnish', 'fr':'French',
'gl':'Galician', 'ka':'Georgian', 'de':'German', 'gr':'Greek', 'gu':'Gujarati', 'ht':'Haitian', 'iw':'Hebrew',
'hi':'Hindi', 'hu':'Hungaric', 'is':'Icelandic', 'id':'Indonesian', 'ga':'Irish', 'it':'Italian', 'ja':'Japanese',
'kn':'Kannada', 'ko':'Korean', 'la':'Latin', 'lv':'Latvian', 'lt':'Lithuanian', 'mk':'Macedonian', 'ms':'Malay',
'mt':'Maltese', 'no':'Norwegian', 'fa':'Persian', 'pl':'Polish', 'pt':'Portuguese', 'ro':'Romanian', 'ru':'Russian',
'sr':'Serbian', 'sk':'Slovak', 'sl':'Slovenian', 'es':'Spanish', 'sw':'Swahili', 'sv':'Swedish', 'ta':'Tamil',
'te':'Telugu', 'th':'Thai', 'tr':'Turkish', 'uk':'Ukrainian', 'ur':'Urdu', 'vi':'Vietnamese', 'cy':'Welsh', 'yi':'Yiddish',
'ar': 'Arabic', 'af': 'Afrikaans', 'sq': 'Albanian', 'hy': 'Armenian', 'az': 'Azerbaijani', 'eu': 'Basque', 'be': 'Belarusian',
'bn': 'Bengali', 'bg': 'Bulgarian', 'ca': 'Catalan', 'zh': 'Chinese', 'hr': 'Croatian', 'cz': 'Czech', 'da': 'Danish',
'nl': 'Dutch', 'en': 'English', 'eo': 'Esperanto', 'et': 'Estonian', 'tl': 'Filipino', 'fi': 'Finnish', 'fr': 'French',
'gl': 'Galician', 'ka': 'Georgian', 'de': 'German', 'gr': 'Greek', 'gu': 'Gujarati', 'ht': 'Haitian', 'iw': 'Hebrew',
'hi': 'Hindi', 'hu': 'Hungaric', 'is': 'Icelandic', 'id': 'Indonesian', 'ga': 'Irish', 'it': 'Italian', 'ja': 'Japanese',
'kn': 'Kannada', 'ko': 'Korean', 'la': 'Latin', 'lv': 'Latvian', 'lt': 'Lithuanian', 'mk': 'Macedonian', 'ms': 'Malay',
'mt': 'Maltese', 'no': 'Norwegian', 'fa': 'Persian', 'pl': 'Polish', 'pt': 'Portuguese', 'ro': 'Romanian', 'ru': 'Russian',
'sr': 'Serbian', 'sk': 'Slovak', 'sl': 'Slovenian', 'es': 'Spanish', 'sw': 'Swahili', 'sv': 'Swedish', 'ta': 'Tamil',
'te': 'Telugu', 'th': 'Thai', 'tr': 'Turkish', 'uk': 'Ukrainian', 'ur': 'Urdu', 'vi': 'Vietnamese', 'cy': 'Welsh', 'yi': 'Yiddish',
'nigger': 'Nigger!',
}
def do_translate(self, line):
"""
translate FROM TO [TEXT]
@ -110,7 +112,7 @@ class Translaboob(ReplApplication):
text = self.acquire_input()
self.start_format(source=text)
for backend, translation in self.do('translate', self.LANGUAGE[lan_from], self.LANGUAGE[lan_to], text):
for backend, translation in self.do('translate', self.LANGUAGE[lan_from], self.LANGUAGE[lan_to], text):
self.format(translation)
self.flush()
except (TranslationFail, LanguageNotSupported) as error:

View file

@ -33,7 +33,8 @@ class Traveloob(ReplApplication):
APPNAME = 'traveloob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = 'Console application allowing to search for train stations and get departure times.'
DESCRIPTION = "Console application allowing to search for train stations and get departure times."
SHORT_DESCRIPTION = "search for train stations and departures"
CAPS = ICapTravel
DEFAULT_FORMATTER = 'table'

View file

@ -53,8 +53,9 @@ class Videoob(ReplApplication):
APPNAME = 'videoob'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Christophe Benz, Romain Bignon, John Obbele'
DESCRIPTION = 'Console application allowing to search for videos on various websites, ' \
'play and download them and get information.'
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
EXTRA_FORMATTERS = {'video_list': VideoListFormatter}
COMMANDS_FORMATTERS = {'search': 'video_list',

View file

@ -37,7 +37,8 @@ class WebContentEdit(ReplApplication):
APPNAME = 'webcontentedit'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = 'Console application allowing to display and edit contents on various websites.'
DESCRIPTION = "Console application allowing to display and edit contents on various websites."
SHORT_DESCRIPTION = "manage websites content"
CAPS = ICapContent
def do_edit(self, line):

View file

@ -38,6 +38,7 @@ class WeboobCfg(ReplApplication):
COPYRIGHT = 'Copyright(C) 2010-2012 Christophe Benz, Romain Bignon'
DESCRIPTION = "Weboob-Config is a console application to add/edit/remove backends, " \
"and to register new website accounts."
SHORT_DESCRIPTION = "manage backends or register new accounts"
COMMANDS_FORMATTERS = {'modules': 'table',
'list': 'table',
}
@ -127,8 +128,8 @@ class WeboobCfg(ReplApplication):
row = OrderedDict([('Name', instance_name),
('Module', name),
('Configuration', ', '.join(
'%s=%s' % (key, ('*****' if key in module.config and module.config[key].masked \
else value)) \
'%s=%s' % (key, ('*****' if key in module.config and module.config[key].masked
else value))
for key, value in params.iteritems())),
])
self.format(row)
@ -144,7 +145,6 @@ class WeboobCfg(ReplApplication):
print >>sys.stderr, 'Backend instance "%s" does not exist' % instance_name
return 1
def _do_toggle(self, name, state):
try:
bname, items = self.weboob.backends_config.get_backend(name)

View file

@ -34,6 +34,7 @@ class WeboobCli(ReplApplication):
SYNOPSIS += ' %prog [--help] [--version]'
DESCRIPTION = "Weboob-Cli is a console application to call a specific method on backends " \
"which implement the given capability."
SHORT_DESCRIPTION = "call a method on backends"
DISABLE_REPL = True
def load_default_backends(self):

View file

@ -29,6 +29,7 @@ class WeboobDebug(BaseApplication):
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Christophe Benz'
DESCRIPTION = "Weboob-Debug is a console application to debug backends."
SHORT_DESCRIPTION = "debug backends"
def __init__(self, option_parser=None):
super(WeboobDebug, self).__init__(option_parser)

View file

@ -42,6 +42,7 @@ class WeboobRepos(ReplApplication):
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2012 Romain Bignon'
DESCRIPTION = "Weboob-repos is a console application to manage a Weboob Repository."
SHORT_DESCRIPTION = "manage a weboob repository"
COMMANDS_FORMATTERS = {'backends': 'table',
'list': 'table',
}

View file

@ -73,8 +73,9 @@ class Weboorrents(ReplApplication):
APPNAME = 'weboorrents'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2012 Romain Bignon'
DESCRIPTION = 'Console application allowing to search for torrents on various trackers ' \
'and download .torrent files.'
DESCRIPTION = "Console application allowing to search for torrents on various trackers " \
"and download .torrent files."
SHORT_DESCRIPTION = "search and download torrents"
CAPS = ICapTorrent
EXTRA_FORMATTERS = {'torrent_list': TorrentListFormatter,
'torrent_info': TorrentInfoFormatter,
@ -97,7 +98,7 @@ class Weboorrents(ReplApplication):
torrent = self.get_object(id, 'get_torrent')
if not torrent:
print >>sys.stderr, 'Torrent not found: %s' % id
print >>sys.stderr, 'Torrent not found: %s' % id
return 3
self.start_format()
@ -143,8 +144,8 @@ class Weboorrents(ReplApplication):
for backend, error, backtrace in errors:
if isinstance(error, MagnetOnly):
print >>sys.stderr, u'Error(%s): No direct URL available, ' \
u'please provide this magnet URL ' \
u'to your client:\n%s' % (backend, error.magnet)
u'please provide this magnet URL ' \
u'to your client:\n%s' % (backend, error.magnet)
return 4
else:
self.bcall_error_handler(backend, error, backtrace)

View file

@ -27,6 +27,7 @@ import sys
__all__ = ['WetBoobs']
class ForecastsFormatter(IFormatter):
MANDATORY_FIELDS = ('id', 'date', 'low', 'high')
@ -38,6 +39,7 @@ class ForecastsFormatter(IFormatter):
result += ' %s' % obj.text
return result
class CurrentFormatter(IFormatter):
MANDATORY_FIELDS = ('id', 'date', 'temp')
@ -49,6 +51,7 @@ class CurrentFormatter(IFormatter):
result += u' - %s' % obj.text
return result
class CitiesFormatter(PrettyFormatter):
MANDATORY_FIELDS = ('id', 'name')
@ -60,7 +63,8 @@ class WetBoobs(ReplApplication):
APPNAME = 'wetboobs'
VERSION = '0.f'
COPYRIGHT = 'Copyright(C) 2010-2011 Romain Bignon'
DESCRIPTION = 'Console application allowing to display weather and forecasts in your city.'
DESCRIPTION = "Console application allowing to display weather and forecasts in your city."
SHORT_DESCRIPTION = "display weather and forecasts"
CAPS = (ICapWeather, ICapGauge)
DEFAULT_FORMATTER = 'table'
EXTRA_FORMATTERS = {'cities': CitiesFormatter,