3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +01:00
Commit Graph

190 Commits

Author SHA1 Message Date
James Lu
5ed4f8bf85 ServiceBot: break when trying to alias a command to itself 2017-07-10 22:18:01 -07:00
James Lu
63ce7ea407 ServiceBot: tweak display format for command aliases
Specifically: bold the command lists, add a space before, and be more specific with "alias for X".
2017-07-10 22:12:53 -07:00
James Lu
bf24bac9c9 ServiceBot: replace 'alias' option with 'aliases' & condense multiple add_cmds calls into one 2017-07-10 21:59:29 -07:00
Mitchell Cooper
f0379d79ef mention that command is an alias or has aliases available in help command 2017-07-09 21:40:08 -04:00
Mitchell Cooper
20abac7461 hide aliases from command list 2017-07-09 21:23:52 -04:00
Mitchell Cooper
2299204efa add alias argument to add_cmd() 2017-07-09 21:18:45 -04:00
James Lu
4e082c2bbf PUIDGenerator: allow custom counter start values 2017-07-05 00:12:25 -07:00
James Lu
6d7e2c667d DeprecatedAttributesObject: don't clobber __ variables 2017-06-30 21:38:50 -07:00
James Lu
8e9a99f90c ServiceBot: migrate to snake case 2017-06-29 23:02:34 -07:00
James Lu
3913a909ef utils: remove parseModes, applyModes wrappers
These have been deprecated since 0.8-alpha2.
2017-06-29 22:43:29 -07:00
James Lu
5647229c05 CamelCaseToSnakeCase: add deprecation warnings 2017-06-29 22:41:18 -07:00
James Lu
6684f9bf08 utils.CC2SC: slightly reword the "missing attribute" error 2017-06-27 16:26:53 -07:00
James Lu
91fe7e0ca7 utils.CC2SC: use self.__class__ to get the name of the current subclass
This is the intended behaviour instead of showing "CamelCaseToSnakeCase" in attribute errors.
2017-06-27 16:25:40 -07:00
James Lu
8f82b92a6a utils: add CamelCaseToSnakeCase class, which wraps missing attributes from camel case names to snake case 2017-06-02 23:16:51 -07:00
James Lu
ed33c8d580 utils: add a default to DeprecatedAttributesObject so that it works as is 2017-06-02 17:26:54 -07:00
James Lu
a3df47e88e ServiceBot: fix ce77f2cbd4 2017-05-07 17:33:15 -07:00
James Lu
ce77f2cbd4 ServiceBot: minor fix of logging syntax 2017-05-07 17:11:51 -07:00
James Lu
5d10ee39be ServiceBot: make displaying unknown command errors optional
Closes #441.
2017-03-28 22:18:51 -07:00
James Lu
c19ea74fb4 ServiceBot: ignore attempts to call empty commands 2017-03-20 22:22:43 -07:00
James Lu
f6d9765f87 core: implement module loading from user-defined directories
Closes #350.
2017-03-08 22:31:57 -08:00
James Lu
805a0502d2 utils: add an alias (utils.IRCParser.REMAINDER) to argparse.REMAINDER
Reported by @IotaSpencer.
2017-03-08 10:02:46 -08:00
James Lu
225b0ac8b2 ServiceBot: catch InvalidArgumentsError for prettier error display on IRC 2017-03-06 16:30:43 -08:00
James Lu
ca93d1ad70 IRCParser: show an error when using "command --help" instead of silently outputting help text in the console 2017-03-06 16:30:43 -08:00
James Lu
76d74ab9bb SECURITY: prevent DoS when calling --help on commands using IRCParser
argparse's default behaviour is to exit after displaying --help and --version information. However, doing so freezes the current IRC listener and essentially allows for DoS via IRC...
This bug does not affect any released (stable) version of PyLInk - only commits after 93c9b6289c
2017-03-06 16:11:04 -08:00
James Lu
7f070448b7 utils, Irc: add abstraction to warn on deprecated attribute usage (#273) 2017-03-05 00:00:26 -08:00
James Lu
e07974f803 utils: remove reference to checkAuthenticated() in NotAuthorizedError 2017-02-24 18:31:33 -08:00
James Lu
0125c544ee utils: add an IRCParser class based off argparse, modified from @IotaSpencer's code
Closes #6.
2017-02-21 21:45:43 -08:00
James Lu
75b5be5baf ServiceBot: implement global and per-service spawn_service(s) options (#403) 2017-02-18 12:54:26 -08:00
James Lu
a776aab897 utils: ignore missing services in unregisterService instead of raising an error
This is a prerequisite for the next commit (service spawn toggle options). (#403)
2017-02-18 12:54:08 -08:00
James Lu
2f968aca80 Irc: allow defaulting to private command replies (Closes #409)
Squashed commit of the following:

commit c168500235b65f833b1d7fe49ebde674159683ee
Author: James Lu <GLolol@overdrivenetworks.com>
Date:   Thu Feb 16 17:33:36 2017 -0800

    ServiceBot: default notice and private to None

    This is so that it respects the changes from the last commit.

commit f685f3ef522f7f0ee356082c3c1b8b5a4e34b211
Author: James Lu <GLolol@overdrivenetworks.com>
Date:   Thu Feb 16 15:10:33 2017 -0800

    Irc: implement a prefer_private_replies option (#409)
2017-02-16 17:41:07 -08:00
James Lu
ad873cfd7b ServiceBot: be more flexible in help formatting
* Fix text after indented docstring line breaks not showing (thanks @IotaSpencer for noticing this)
* Update formatting so that multiple consecutive newlines in a docstring are shown:
    - 2 newlines => 1 displayed new line
    - 3 newlines => 2 displayed new lines, and so on...
2017-02-15 17:06:16 -08:00
James Lu
d33eb22ca3 ServiceBot: verify that the service name is a valid nick 2017-01-21 11:59:43 -08:00
James Lu
d31d09ce7e ServiceBot: remove extra_channels argument from the constructor
This is unused and a poor thing to hardcode anyways.
2017-01-21 11:59:43 -08:00
James Lu
702ba84956 wrapArguments: add a max_args_per_line option (#253) 2017-01-11 23:09:25 -08:00
James Lu
d4b4cfb32e wrap* funcs: convert input args to a list, so that pop(0) always works 2017-01-06 22:13:27 -08:00
James Lu
12c33fcddf utils: remove incomplete example text for wrapArguments() 2017-01-02 11:08:55 -08:00
James Lu
eafec9d4ad utils: add wrapArguments() to deal with S2S message cutoffs
Ref: #253, #378
2016-12-31 23:35:27 -08:00
James Lu
95b58fc2c4 utils: abstract protocol/plugin import prefixes, and implement filtering by plugin in 'list'
Closes #369.
2016-12-16 19:25:41 -08:00
James Lu
03766b9f89 ServiceBot: implement docstring rewrapping per #307.
Closes #307.
2016-12-05 23:33:03 -08:00
James Lu
f5633329f8 utils: drop loadModuleFromFolder; it is unused since bcc84b8618 2016-12-04 23:35:16 -08:00
Ken Spencer
a1bbb4fdb9 utils: style points! WOOOO 2016-11-18 23:10:45 -08:00
Ken Spencer
fdd4135632 utils: add error() to use classes.py's irc.error() 2016-11-18 23:10:45 -08:00
James Lu
438838f81d ServiceBot: handle autojoin additions even if bots haven't spawned yet 2016-09-24 12:33:57 -07:00
James Lu
a040c3c7d2 ServiceBot: modularize join() for explicit channel joining (#326) 2016-09-23 23:43:07 -07:00
James Lu
9e7d0a50ca Revert "ServiceBot: fall back to a space in 'help' when stripped text is empty"
This reverts commit 7a3c8ab637.
2016-08-27 09:49:59 -07:00
James Lu
06cbbbb019 ServiceBot: display the NotAuthorizedError argument raw 2016-08-25 00:58:19 -07:00
James Lu
5908776a86 API CHANGE: Rename NotAuthenticatedError -> NotAuthorizedError 2016-08-25 00:43:44 -07:00
James Lu
7d2b22630d ServiceBot: display custom error messages for NotAuthenticatedError 2016-08-25 00:41:53 -07:00
James Lu
3126560fb9 ServiceBot: use newline-agnostic str.splitlines() to split up docstrings 2016-08-02 12:38:15 -07:00
James Lu
7a3c8ab637 ServiceBot: fall back to a space in 'help' when stripped text is empty
This makes sure things like newlines actually show when displaying docstrings. Closes #306.
2016-08-02 12:32:06 -07:00