1
0
Fork 0
Commit Graph

22 Commits

Author SHA1 Message Date
nemunaire 445a66ea90 hooks: keywords can have optional values: place a question mark before =
{
	    "keyword?=X": "help about keyword (precise the default value if needed)"
	}
2018-09-25 21:25:02 +02:00
nemunaire 342bb9acdc Refactor in treatment analysis 2018-06-06 14:50:44 +02:00
nemunaire 7cf73fb84a Remove reload feature
As reload shoudl be done in a particular order, to keep valid types, and because maintaining such system is too complex (currently, it doesn't work for a while), now, a reload is just reload configuration file (and possibly modules)
2017-07-16 21:17:48 +02:00
nemunaire 6cd299ab60 New keywords class that accepts any keywords 2017-07-16 21:17:48 +02:00
nemunaire 2c3d61495f Welcome in 2016... Happy new year! 2016-04-08 12:55:24 +02:00
nemunaire 43c42e1397 Rework hook managment and add some tests 2015-11-18 20:21:05 +01:00
nemunaire 36cfdd8861 Added check and match module defined functions to hooks 2015-11-13 17:05:27 +01:00
nemunaire f39a0eac56 Refactors hooks registration 2015-11-03 16:53:49 +01:00
nemunaire 49d7e4ced6 Hooks: add global methods to restrict read/write on channels 2015-11-03 16:35:19 +01:00
nemunaire ea9829b341 Check command keywords using keyword help (passed in @hook) 2015-11-03 07:23:21 +01:00
nemunaire 9790954dfc Hooks can now contain help on optional keywords 2015-11-03 07:22:01 +01:00
nemunaire 8b4f08c5bd Replace IRCException by IMException, as nemubot is not only built for IRC 2015-11-03 07:21:06 +01:00
nemunaire ac33ceb579 Remove dead or useless code 2015-11-03 07:20:52 +01:00
nemunaire a4fd04c310 Remove print unhandled in daemon mode 2015-10-20 18:02:01 +02:00
nemunaire 4cb8b0f1a6 Improve help
On hook declaration, we can now add a help and/or a help_usage argument
	to provide a simple way to the user to be informed.

	For example:

	```python
	@hook("cmd_hook", "news", help_usage={"URL": "Display the latests news from a given URL"})
	def cmd_news(msg):
	    [...]
	```

	will be displayed on !help !news as:

	> Usage for command !news from module news: !news URL: Display the latests news from a given URL

	Or for module commands help:

	```python
	@hook("cmd_hook", "news", help="display latests news")
	def cmd_news(msg):
	    [...]
	```

	will be displayed on !help mymodule (assuming this hook is in the
	module named mymodule) as:

	> Available commands for module news: news: display latests news

	Obviously, both `help` and `help_usage` can be present. If `help_usage`
	doesn't exist, help on usage will display the content of help.
2015-09-24 11:29:51 +02:00
nemunaire 3c51b1f03b Add assertion on class initialization 2015-09-24 11:29:49 +02:00
nemunaire 787a5fd3da Web tool raise more IRCException 2015-08-26 12:17:21 +02:00
nemunaire 002f2463a3 Extract hooks 2015-05-25 16:44:28 +02:00
nemunaire c8d495d508 Split messages class into multiple files 2015-05-25 16:44:27 +02:00
nemunaire e588c30044 Optimize imports 2015-05-25 16:44:16 +02:00
nemunaire 5a6230d844 [wip] changes import to reflect new directory structure 2015-01-05 02:48:49 +01:00
nemunaire 41f7dc2456 [wip] move files in order to have a clean directory structure 2015-01-04 15:14:35 +01:00