Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Commit

Permalink
Merge branch 'develop' into drillsqueak
Browse files Browse the repository at this point in the history
License and bugfixes
  • Loading branch information
Marenthyu committed Apr 26, 2017
2 parents 27dc370 + 62077b7 commit a9c67aa
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 4 deletions.
29 changes: 29 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2017 The Fuel Rats Mischief,
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 changes: 14 additions & 2 deletions sopel-modules/rat-board.py
Original file line number Diff line number Diff line change
Expand Up @@ -1010,14 +1010,24 @@ def cmd_grab(bot, trigger, client):


@commands('inject')
@parameterize("wT", usage="<client or case number> <text to add>")
@require_rat('Sorry, you need to be a registered and drilled Rat to use this command.')
# Using this to prevent cases from created if they are not found, therefor created, but no line to add was specified.
def cmd_inject(bot, trigger, case, line):
"""
Inject a custom line of text into the client's case.
required parameters: Client name or case number, quote to add.
"""
func_inject(bot, trigger)

@ratlib.sopel.filter_output
@parameterize('FT', usage='<client or case number> <text to add>')
@require_rat('Sorry, you need to be a registered and drilled Rat to use this command.')
def cmd_inject(bot, trigger, find_result, line):
def func_inject(bot, trigger, find_result, line):
"""
Inject a custom line of text into the client's case.
required parameters: Client name or case number, quote to add.
"""
# Can probably be removed, keeping it with the above comment so s/o else later understands it.
if not line:
raise UsageError()
result = append_quotes(bot, find_result, line, create=True)
Expand Down Expand Up @@ -1490,6 +1500,7 @@ def cmd_reopen(bot, trigger, id):
try:
result = callapi(bot, 'PUT', data={'open': True}, uri='/rescues/' + str(id), triggernick=str(trigger.nick))
refresh_cases(bot, force=True)
updateBoardIndexes(bot)
bot.say('Reopened case. Cases refreshed, care for your case numbers!')
except ratlib.api.http.APIError:
# print('[RatBoard] apierror.')
Expand Down Expand Up @@ -1545,6 +1556,7 @@ def cmd_mdlist(bot, trigger):
@commands('quoteid')
@require_overseer(message='Sorry pal, you\'re not an overseer or higher!')
@parameterize('+', usage='<id>')
@ratlib.sopel.filter_output
def cmd_quoteid(bot, trigger, id):
"""
Quotes a case by its database id
Expand Down
8 changes: 6 additions & 2 deletions sopel-modules/rat-facts.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,10 +339,14 @@ def _translation_stats(exists, missing, s='translation', p='translations'):
_translation_stats(exists, missing, s=opposite_name_s, p=opposite_name_p)
)
if full:
pm(summary)
lines = textwrap.wrap(summary, 400, break_long_words=False)
for l in lines:
pm(l)
return NOLIMIT
else:
bot.say(summary)
lines = textwrap.wrap(summary, 400, break_long_words=False)
for l in lines:
bot.say(l)
return NOLIMIT

bot.reply("'{}' is not a known fact, language, or subcommand".format(command))
Expand Down

0 comments on commit a9c67aa

Please sign in to comment.