Commit Graph

235 Commits

Author SHA1 Message Date
Valentin Lorentz fec6959acb all plugins: regenerate READMEs 2021-04-22 00:29:15 +02:00
Valentin Lorentz 82fbfcffa4 all plugins: regenerate READMEs 2021-04-17 20:09:33 +02:00
Valentin Lorentz cd02444f87 supybot-plugin-doc: Add labels for all command and config variables
So they can be referenced from elsewhere in the doc.
2021-04-06 00:33:07 +02:00
Valentin Lorentz 833af36b08 all plugins: auto-generate READMEs
Starting with this commit, there should be no "original" text
in READMEs.
Instead, the entire text should be in docstrings, and READMEs
should be automatically generated from these docstrings.

Motivation:

* The same help is available both via IRC and in the README
  (although the README can be more detailed, as only the first
  paragraph will be shown on IRC)
* This will allow auto-generating plugin help on docs.limnoria.net
  using the same content as the README, as it's sourced from the
  docstrings

Additionally, this converts all READMEs from Markdown to ReST,
because the documentation already uses ReST, and other docstrings
in the codebase are in ReST for this reason.
2021-04-05 17:42:31 +02:00
Valentin Lorentz c04b31ae32 RSS: include channel name in 'feed is announced but does not exist' error log. 2020-10-10 11:51:56 +02:00
Valentin Lorentz 4bd5d8eb33 RSS: Fix announce removal to work with net+chan-specific config
It only removed the value from the chan-specific value.
2020-10-10 11:51:56 +02:00
Valentin Lorentz 0102d64cf4 RSS: fix tests with feedparser 6.
Mocks the urllib API it uses instead of an internal function.
2020-09-19 10:15:23 +02:00
Valentin Lorentz 2953126fca test: Make assertNoResponse default to a non-zero timeout for threaded plugins.
Else it doesn't reliably check there is no response.
2020-04-11 00:17:16 +02:00
Valentin Lorentz e2d72c5a43 Fix msgfmt warnings. 2020-03-26 22:10:28 +01:00
Valentin Lorentz 2f49362510 RSS: If ids are missing, use <link> as id. 2020-01-31 20:59:42 +01:00
Valentin Lorentz 653afdd086 RSS: Show a meaningful error in case '@rss' is called with a non-URL/name.
Instead of letting feedparser try to parse the name.
2020-01-28 19:35:05 +01:00
Valentin Lorentz 9ab908759a Use importlib instead of imp.
importlib is deprecated.
2020-01-26 12:00:08 +01:00
Valentin Lorentz 9891b0fca4 Replace failUnless/failIf with assertTrue/assertFalse.
The old names are deprecated.
2020-01-26 11:14:18 +01:00
James Lu 9291fbd4a0 All plugins: set Limnoria contributors as maintainer 2019-11-16 11:41:13 -08:00
Valentin Lorentz f85287771d RSS: Register feed config in config.py instead of plugin.py.
So they are not dropped if plugin.py fails to load before
feedparser is not installed.

Closes GH-1387.
2019-11-11 19:42:34 +01:00
James Lu 3c23faf1bd RSS: add 'announce channels' command to list channels a feed is announced to
Closes #1322.
2019-10-06 20:46:21 +02:00
Valentin Lorentz 702cfaaf97 RSS: Fix __repr__ formatter. 2019-10-05 15:57:28 +02:00
Valentin Lorentz dcf55cf6de RSS: Use an explicit timeout for assertNoResponse, because it defaults to 0.
Which means there may be a command/update thread running and returning after assertNoResponse returns.
In particular, that's an issue when assertNoResponse is called right before
setting feedparser._open_resource, because the running thread might still
be holding the lock but have fetched the new version already, so the
thread announces the new feed elements earlier than expected.
2019-10-05 15:57:01 +02:00
Valentin Lorentz a4665803fa News + RSS: Mock time.time() instead of using time.sleep() in tests.
Saves 40s over the ~5min test suite.
2019-10-05 12:22:30 +02:00
Valentin Lorentz c1ae3f5c81 all plugins: Use msg.channel instead of msg.args[0] + give network name to self.registryValue. 2019-08-24 23:35:01 +02:00
Valentin Lorentz 696254ff1b Use irc.isChannel instead of ircutils.isChannel when possible.
It's aware of the network's 'chantypes'.
2019-08-04 21:52:40 +02:00
James Lu c7716de887 RSS: add a quick test for a malformed feed that has no entries
(Only both of these combined gives new output so far.)
2018-10-14 12:42:15 -07:00
James Lu 2fdc433cb3 RSS: show soft errors set by feedparser when no entries are found
Hopefully this will ease debugging - e.g. a bad TLS certificate will now show
"Error: Couldn't get RSS feed. Parser error: <urlopen error
 [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:720)>"
instead of only a generic message.
2018-10-14 12:41:22 -07:00
Tasos Sahanidis b900a369a4 RSS: Fix feeds with missing description or title
An AttributeError would be raised when a blacklist or a whitelist
would be set on feeds that miss either a title or a description.
2018-03-13 23:50:47 +01:00
Valentin Lorentz 3ab226c129 RSS: Only defer feed loading at plugin load while the bot is starting.
Defering it if the plugin is (re)loaded while already running is useless.
Closes GH-922.
2017-12-10 09:39:20 +01:00
James Lu bdd0adfef5 RSS: add missing configuration help for feed URL options
This fixes confusing "That configuration group exists, but seems to have no help." errors on the URL
options for feeds, when these options are actually relevant and settable.
2017-12-09 23:03:42 -08:00
Valentin Lorentz e08e899134 Fix test 2017-10-21 17:11:21 +02:00
Valentin Lorentz e16faab805 RSS: On startup, only delay feeds loading for 10 seconds instead of the whole of supybot.plugins.RSS.waitPeriod. 2017-10-21 16:48:44 +02:00
Valentin Lorentz eaa5a5523e RSS: Add var supybot.plugins.RSS.maximumAnnounceHeadlines. 2017-10-12 21:21:50 +02:00
Valentin Lorentz d73de5e512 Fix potential bug due to mutability of lists as default argument. 2017-03-30 21:38:18 +00:00
Valentin Lorentz 3633a2b2e3 RSS: Only keep the most recent entries in the initial announce. 2017-01-27 21:00:58 +01:00
Valentin Lorentz d7099794bc Fix Python 2 support of last commit. 2016-09-20 23:22:13 +02:00
Valentin Lorentz 2cfe0f679f Fix previous commit on some Python versions. 2016-09-20 23:09:29 +02:00
Valentin Lorentz d39647142c RSS: Fix shadowing of any/all. 2016-09-20 22:54:11 +02:00
Valentin Lorentz 4f280599e1 RSS: use the original FeedParserDict for substitution
instead of building a new keyword arguments dict by iteration.

'description' is a field in FeedParserDict, but is not present when iterating,
which made it unavailable as a substitution variable.
2016-09-08 21:42:31 +02:00
Valentin Lorentz 3776404628 RSS: Use HTTP(S) proxy. Closes GH-1234. 2016-08-16 10:56:29 +02:00
Valentin Lorentz 3f66dbc3d5 Channel & Dunno & Misc & RSS & Scheduler: Let the logging facility perform string templating to avoid extra format chars in argument. 2015-11-03 17:25:13 +01:00
Valentin Lorentz fb52b16429 RSS: Allow @announce add to take URLs as feed names. 2015-10-10 20:40:25 +02:00
Valentin Lorentz 4498548cb3 RSS: Add supybot.plugins.RSS.notice. Closes GH-1151. 2015-09-23 11:27:20 +02:00
Valentin Lorentz 82332ff87c RSS: Add feed-specific waitPeriod. 2015-09-23 11:05:25 +02:00
Valentin Lorentz 1c218592af RSS: Add fallback on sorting by update timestamp + add outdatedFirst and updatedFirst sorts. Closes GH-1139. 2015-09-02 10:04:04 +02:00
Valentin Lorentz 29ca3eb5e4 RSS: Sort on time tuples instead of formatted dates. 2015-09-02 09:43:29 +02:00
Valentin Lorentz c3a2c800f1 Remove need for 2to3. 2015-08-11 16:50:23 +02:00
Valentin Lorentz c0ac84bb53 Remove need for fix_import, fix_types, and fix_urllib. 2015-08-10 17:55:25 +02:00
Valentin Lorentz 216c5d213f Replace sys.version_info[0] usages with minisix.PY{2,3}. 2015-08-09 00:23:03 +02:00
Valentin Lorentz 7c4a28d7fd RSS: Remove illegal characters from entries. 2015-06-01 19:32:40 +02:00
Valentin Lorentz ac0e6b86c0 RSS: Fix typo. 2015-05-23 11:48:32 +02:00
Valentin Lorentz 34138b9185 RSS: Don't crash on load if there is an invalid feed name. Closes GH-1116. 2015-05-23 11:40:26 +02:00
Valentin Lorentz 2008956968 RSS: Reove broken (and probably irrelevant) link in the README. 2015-05-10 09:57:11 +00:00
Aminda Suomalainen a5cfad3a05 RSS: rewrite basic usage in README 2015-01-27 09:13:30 +02:00