★ wanayoo — archive 1999 https://github.com/python-discord/code-jam-1/pull/9Nouvelle recherche | Portail wanayoo
Skip to content
This repository has been archived by the owner. It is now read-only.

Team 16 #9

Open
wants to merge 13 commits into
base: master
from
Open

Team 16 #9

wants to merge 13 commits into from

Conversation

@supposedly
Copy link

@supposedly supposedly commented Mar 23, 2018 •

With @ShawSumma

@supposedly supposedly force-pushed the supposedly:master branch from b0d66cb to 0fcaccd Mar 23, 2018
Pipfile Outdated
aiodns = "*"
bs4 = "*"
html2text = "*"

This comment has been minimized.

@gdude2002

gdude2002 Mar 23, 2018
Contributor

You have edited the Pipfile directly, and in a way that will break discord.py. Please revert your Pipfile and read over the doc/ folder again.

This comment has been minimized.

@supposedly

supposedly Mar 23, 2018
Author

I don't believe we'd had this change to the Pipfile PR'd yet, because I don't remember deleting the aiohttp/websockets lines. But also -- doesn't discord.py itself pin these two deps in its own requirements.txt?

This comment has been minimized.

@gdude2002

gdude2002 Mar 23, 2018
Contributor

It does pin aiohttp and websockets, but Pipenv doesn't pick up on it correctly if they aren't specified directly in the pipfile. You also can't just use the latest version of aiohttp, it's not compatible.

I make a PR this morning, maybe check that out.

This comment has been minimized.

@supposedly

supposedly Mar 23, 2018
Author

Gotcha, & just saw that! I'll fix all this as soon as I get home.


async def get_snek(self, name: str = None) -> Dict[str, Any]:

This comment has been minimized.

@gdude2002

gdude2002 Mar 23, 2018
Contributor

Why did you remove the type hinting?

This comment has been minimized.

@supposedly

supposedly Mar 23, 2018 •
Author

Sorry. My partner was for a short while only able to use python 3.5 (and typing was added in 3.6) so I started removing hints preemptively for compatibility -- didn't take care to put them all back once he was able to get on 3.6, though.

@command()
async def get(self, ctx: Context, name: str = None):
@commands.command()
async def get(self, ctx, name: str.title = None):

This comment has been minimized.

@gdude2002

gdude2002 Mar 23, 2018
Contributor

You removed the type hinting for ctx. This will break things. Also, you can't type hint str.title.

This comment has been minimized.

@supposedly

supposedly Mar 23, 2018 •
Author

huh, what would the Context typehint do and/or break? (are you folks running a type checker?)

The str.title typehint is a converter -- see Rapptz/discord.py#1064 (bad pr on my part but it's there) and the documentation on converters. Converting to str is in fact redundant as far as ext.commands is concerned.

[BUT: I've also just realized I don't even want to convert with str.title(), because Wikipedia articles are titled in This case. Oops]

@supposedly supposedly force-pushed the supposedly:master branch from 3b22c61 to a2b8981 Mar 24, 2018
@supposedly supposedly force-pushed the supposedly:master branch from a2b8981 to c56db82 Mar 24, 2018
Copy link
Contributor

@gdude2002 gdude2002 left a comment

Actually not too bad overall.

@@ -1,300 +0,0 @@
{

This comment has been minimized.

@gdude2002

gdude2002 Mar 25, 2018
Contributor

This file does need to be in the repo.

from typing import Any, Dict

from discord.ext.commands import AutoShardedBot, Context, command

This comment has been minimized.

@gdude2002

gdude2002 Mar 25, 2018
Contributor

Why not keep it like this? Seems cleaner than what you did below

from discord.ext import commands
from discord.ext.commands import Context

from .. import hardcoded

This comment has been minimized.

@gdude2002

gdude2002 Mar 25, 2018
Contributor

Do not use relative imports please.

'&prop=pageimages|categories'
'&pithumbsize=300'
f"&cllimit=max&clcategories={'|'.join(hardcoded.categories)}"
)

This comment has been minimized.

@gdude2002

gdude2002 Mar 25, 2018
Contributor

Maybe unindent this paren one level?

name = await self.get_rand_snek()

async with self.session.get(self.base_query.format(name)) as pg_resp, \
self.session.get(self.info_query.format(name)) as if_resp: # noqa

This comment has been minimized.

@gdude2002

gdude2002 Mar 25, 2018
Contributor

What error are you squelching here? Indentation?

@supposedly supposedly force-pushed the supposedly:master branch 5 times, most recently from 5a015eb to 22d874c Mar 25, 2018
@supposedly supposedly force-pushed the supposedly:master branch from 22d874c to e043abb Mar 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.