Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
[RELEASE] 1.6.1

See merge request hull-seals/code/irc/halpybot!141
  • Loading branch information
Rixxan committed Aug 13, 2022
2 parents 2b4d26c + a7baeec commit a611ada
Show file tree
Hide file tree
Showing 82 changed files with 367 additions and 284 deletions.
2 changes: 1 addition & 1 deletion CLI/BackupFactUpdater/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Simple tool for automatically updating the backup fact file
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion CLI/DSSAUpdater/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
Spreadsheet data used with permission from Fleetcomm and
DSSA administration
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down
4 changes: 1 addition & 3 deletions CLI/DSSAUpdater/src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
HalpyBOT v1.6
__init__.py - Initilization for DSSA Updater module
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down
4 changes: 2 additions & 2 deletions CLI/DSSAUpdater/src/carrier.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
carrier.py - DSSA carrier object
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down Expand Up @@ -79,7 +79,7 @@ def __eq__(self, other):
"""
if not isinstance(other, DSSACarrier):
return False
return self.name.lower() == other.name.lower()
return self.name.casefold() == other.name.casefold()

def __repr__(self):
"""Return a string representation of the carrier
Expand Down
4 changes: 2 additions & 2 deletions CLI/DSSAUpdater/src/scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
scraper.py - Spreadsheet scraper function, powered by BeautifulSoup
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down Expand Up @@ -63,7 +63,7 @@ def scrape_spreadsheet(path: str, sheetlink: str, timestamp: str):
for index, row in enumerate(rows):
if row == [""] * 20: # This would be an empty row, ignore it
continue
if row[2].lower() != "carrier operational": # 2 - Carrier status
if row[2].casefold() != "carrier operational": # 2 - Carrier status
continue
if row[9] == "": # 9 - Carrier name
anomalies.append(f"{index + 1} - Name field has no value")
Expand Down
2 changes: 1 addition & 1 deletion CLI/EDDBFormatter/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
EDDB File Formatter
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,9 @@ have to start with a docstring of the following format:

```python
"""
HalpyBOT v[VERSION]
file_name.py - One-sentence description of what this file does.
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HalpyBOT 1.6
# HalpyBOT 1.6.1
This is the repository for HalpyBOT, the Hull Seals IRC Chatbot Assistant.

# Description
Expand Down
6 changes: 5 additions & 1 deletion config/config_template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ message_channel = #seal-bob
failure_button = False

[UserAgent]
agent_comment = Your Organization Here
agent_comment = Your Organization Here

[YOURLS]
uri = YOURLS URL Here
pwd = Your PasswordlessAPI Key here
5 changes: 5 additions & 0 deletions data/help/commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@
"aliases": [],
"arguments": "[channel] [text]",
"use": "Make the Bot say something"
},
"shorten": {
"aliases": [],
"arguments": "[url]",
"use": "Shorten a provided URL"
}
},
"Delay": {
Expand Down
6 changes: 2 additions & 4 deletions halpybot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
HalpyBOT v1.6
__init__.py - Initilization for HalpyBOT core
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand All @@ -12,7 +10,7 @@

from halpybot.packages.configmanager import config

__version__ = "1.5.3"
__version__ = "1.6.1"

DEFAULT_USER_AGENT = (
"HalpyBOT/"
Expand Down
6 changes: 3 additions & 3 deletions halpybot/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
HalpyBOT v1.6
__init__.py - Initilization for HalpyBOT Commands
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand All @@ -25,6 +23,7 @@
from . import bot_help
from . import caseutils
from . import drill
from . import misc

__all__ = [
"delayedboard",
Expand All @@ -42,4 +41,5 @@
"bot_help",
"caseutils",
"drill",
"misc",
]
4 changes: 1 addition & 3 deletions halpybot/commands/bot_help.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
HalpyBOT v1.6
bot_help.py - get command list and command details when queried
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down
4 changes: 1 addition & 3 deletions halpybot/commands/caseutils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
HalpyBOT v1.6
caseutils.py - Commands involving the management of Seal cases
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down
11 changes: 8 additions & 3 deletions halpybot/commands/delayedboard.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
HalpyBOT v1.6
delayedboard.py - Delayed Case Board commands
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand Down Expand Up @@ -49,6 +47,7 @@ async def cmd_create_delayed_case(ctx: Context, args: List[str]):
try:
results = await DelayedCase.open(case_status, message, ctx.sender)
except NoDatabaseConnection:
logger.exception("Offline Mode Set, No Database Connection")
return await ctx.reply(
"Cannot create case: running in OFFLINE MODE. "
"Contact a cyberseal immediately!"
Expand Down Expand Up @@ -93,6 +92,7 @@ async def cmd_reopen_delayed_case(ctx: Context, args: List[str]):
try:
results = await DelayedCase.reopen(case_id, casestat, ctx.sender)
except NoDatabaseConnection:
logger.exception("Offline Mode Set, No Database Connection")
return await ctx.reply(
"Cannot reopen case: running in OFFLINE MODE. "
"Contact a cyberseal immediately!"
Expand Down Expand Up @@ -127,6 +127,7 @@ async def cmd_close_delayed_case(ctx: Context, args: List[str]):
case_id, 3, ctx.sender
) # set casestat to 3 to close case
except NoDatabaseConnection:
logger.exception("Offline Mode Set, No Database Connection")
return await ctx.reply(
"Cannot update case: running in OFFLINE MODE. "
"Contact a cyberseal immediately!"
Expand Down Expand Up @@ -163,6 +164,7 @@ async def cmd_update_delayed_status(ctx: Context, args: List[str]):
try:
results = await DelayedCase.status(case_id, casestat, ctx.sender)
except NoDatabaseConnection:
logger.exception("Offline Mode Set, No Database Connection")
return await ctx.reply(
"Cannot update case: running in OFFLINE MODE. "
"Contact a cyberseal immediately!"
Expand Down Expand Up @@ -207,6 +209,7 @@ async def cmd_update_delayed_notes(ctx: Context, args: List[str]):
try:
results = await DelayedCase.notes(case_id, message, ctx.sender)
except NoDatabaseConnection:
logger.exception("Offline Mode Set, No Database Connection")
return await ctx.reply(
"Cannot update case: running in OFFLINE MODE. "
"Contact a cyberseal immediately!"
Expand Down Expand Up @@ -235,6 +238,7 @@ async def cmd_check_delayed_cases(ctx: Context, args: List[str]):
try:
count = await DelayedCase.check()
except NoDatabaseConnection:
logger.exception("Offline Mode Set, No Database Connection")
return await ctx.reply(
"Cannot connect to board: running in OFFLINE MODE. "
"Contact a cyberseal immediately!"
Expand Down Expand Up @@ -287,6 +291,7 @@ async def cmd_update_delayed_case(ctx: Context, args: List[str]):
notesout = await DelayedCase.notes(case_id, message, ctx.sender)

except NoDatabaseConnection:
logger.exception("Offline Mode Set, No Database Connection")
return await ctx.reply(
"Cannot update case: running in OFFLINE MODE. "
"Contact a cyberseal immediately!"
Expand Down
7 changes: 3 additions & 4 deletions halpybot/commands/drill.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
"""
HalpyBOT v1.6
drill.py - Commands for the training and drilling of Seals
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
See license.md
"""
from typing import List

from loguru import logger
from ..packages.command import Commands, get_help_text
from ..packages.checks import Require, Drilled
from ..packages.models import Context
Expand Down Expand Up @@ -158,4 +156,5 @@ async def lookup(system):
)
return "System Not Found in EDSM.\nPlease check system name with client "
except EDSMLookupError:
logger.exception("Something went wrong with EDSM.")
return "Unable to query EDSM"
44 changes: 37 additions & 7 deletions halpybot/commands/edsm.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
"""
HalpyBOT v1.6
edsm.py - EDSM Interface commands
Copyright (c) 2022 The Hull Seals,
Copyright (c) The Hull Seals,
All rights reserved.
Licensed under the GNU General Public License
Expand All @@ -24,6 +22,7 @@
diversions,
NoResultsEDSM,
NoNearbyEDSM,
EDSMReturnError,
)
from ..packages.command import Commands, get_help_text
from ..packages.models import Context
Expand Down Expand Up @@ -60,7 +59,11 @@ async def cmd_systemlookup(ctx: Context, args: List[str]):
return await ctx.reply(
f"No system named {system} was found in the EDSM database."
)

except EDSMReturnError:
logger.exception("Received malformed reply from EDSM.")
return await ctx.reply(
f"Received a reply from EDSM about {system}, but could not process the return."
)
except EDSMLookupError:
logger.exception("Failed to query EDSM for system details.")
return await ctx.reply("Failed to query EDSM for system details.")
Expand Down Expand Up @@ -91,9 +94,13 @@ async def cmd_cmdrlocate(ctx: Context, args: List[str]):
location = await Commander.location(name=cmdr, cache_override=cache_override)
except NoResultsEDSM:
return await ctx.reply(f"No CMDR named {cmdr} was found in the EDSM database.")
except EDSMReturnError:
logger.exception("Received malformed reply from EDSM.")
return await ctx.reply(
f"Received a reply from EDSM about {cmdr}, but could not process the return."
)
except EDSMConnectionError:
logger.exception("Failed to query EDSM for commander data.")
# kill it. kill it with fire. ~ TheUnkn0wn1
return await ctx.reply("Failed to query EDSM for commander data.")

if location is None:
Expand Down Expand Up @@ -139,6 +146,11 @@ async def cmd_distlookup(ctx: Context, args: List[str]):
return await ctx.reply(
"No system and/or commander was found in the EDSM database for one of the points."
)
except EDSMReturnError:
logger.exception("Received a malformed reply from EDSM.")
return await ctx.reply(
"Received a reply from EDSM, but could not process the return."
)
except EDSMLookupError:
logger.exception("Failed to query EDSM for system or CMDR details.")
return await ctx.reply("Failed to query EDSM for system or CMDR details.")
Expand Down Expand Up @@ -191,8 +203,11 @@ async def cmd_landmarklookup(ctx: Context, args: List[str]):
f"The closest DSSA Carrier is in {dssa}, {distance} LY "
f"{direction} of {system}."
)
logger.exception("Failed to query EDSM for landmark details.")
return await ctx.reply("Failed to query EDSM for landmark details.")
except EDSMReturnError:
logger.exception("Received a malformed reply from EDSM.")
return await ctx.reply(
f"Received a reply from EDSM about {system}, but could not process the return."
)


@Commands.command("dssa")
Expand Down Expand Up @@ -231,6 +246,11 @@ async def cmd_dssalookup(ctx: Context, args: List[str]):
return await ctx.reply(
f"No system and/or commander named {system} was found in the EDSM database."
)
except EDSMReturnError:
logger.exception("Received a malformed reply from EDSM.")
return await ctx.reply(
f"Received a reply from EDSM about {system}, but could not process the return."
)
except EDSMLookupError:
logger.exception("Failed to query EDSM for DSSA details.")
return await ctx.reply("Failed to query EDSM for DSSA details.")
Expand Down Expand Up @@ -264,6 +284,11 @@ async def cmd_coordslookup(ctx, args: List[str]):
return await ctx.reply(
f"No system and/or commander named {system} was found in the EDSM database."
)
except EDSMReturnError:
logger.exception("Received a malformed reply from EDSM.")
return await ctx.reply(
f"Received a reply from EDSM about {system}, but could not process the return."
)
except EDSMLookupError:
logger.exception("Failed to query EDSM for coordinate details.")
return await ctx.reply("Failed to query EDSM for coordinate details.")
Expand Down Expand Up @@ -318,6 +343,11 @@ async def cmd_diversionlookup(ctx: Context, args: List[str]):
return await ctx.reply(
f"No system and/or commander named {system} was found in the EDSM database."
)
except EDSMReturnError:
logger.exception("Received a malformed reply from EDSM.")
return await ctx.reply(
f"Received a reply from EDSM about {system}, but could not process the return."
)
except EDSMLookupError:
logger.exception("Failed to query EDSM for coordinate details.")
return await ctx.reply("Failed to query EDSM for coordinate details.")
Loading

0 comments on commit a611ada

Please sign in to comment.