#dev-contrib

1 messages · Page 45 of 1

eternal owl
#

but when using it they should be spaced?

rocky bloom
#

when that is a child element

eternal owl
#

So i need to have another div below that

rocky bloom
#

so <element class="notification is-info"> is a child of <element class="messages">

eternal owl
#

i cant use div?

rocky bloom
#

element can be whatever

eternal owl
#

okay

#

any more changes needed to the detail page?

#

what do you guys think

#

I think I should make the image a lil bigger

hardy gorge
#

How's the UI/UX in your experience? Aside from the purely aesthetical aspects.

#

What would you want to do as a user here?

#

I'd say that if you're browsing tags, some kind of UI to browse to the "next" or "previous" tag (alphabetical order?) could be nice

eternal owl
#

oh yea the arrow marks

hardy gorge
#

Also, does the general ListView have a default ordering? We could specify that in the model meta options.

eternal owl
#

there is no ordering set in the model

hardy gorge
#

Okay, we probably do want that, since it would make locating a tag much easier

eternal owl
#

yea, alphabetically could do

eternal owl
#

Do we want me to add that ordering while I am working on this?

green oriole
#

Well, we want those tags to be ordered right?

eternal owl
#

yep

green oriole
#

So it would be easier, right?

eternal owl
#

yea

#

btw ak do you where all the logs are?

green oriole
#

The logs?

#

Of the website?

eternal owl
#

yea

green oriole
#

They should be printed to the terminal output

eternal owl
#

do print statements work in class based views?

green oriole
#

I don't know, probably not

eternal owl
#

ohk

green oriole
#

You could always add some logging lines instead of a print

#

Or use a real debugger :P

clever wraith
#

@green oriole wonder you can review my PR ?

#

@eternal owl you too

#

#349 seasonalbot

eternal owl
#

This time i will use debugger

green oriole
#

I don't think our reviews really count now

eternal owl
#

to use vscode debugger, should I run the project through vs code?

#

or should i get pycharm pithink

green oriole
#

I don't really know, I haven't really played with the debugger yet

eternal owl
#

okay

#

shit

#

I forgot I had to do regular commits

hardy gorge
#

I don't think you've pushed anything yet, right? You can always clean up your local history before pushing it.

#

With git add -i (or a gui tool), you can interactively commit chunks/individual lines in files

eternal owl
#

wow thats cool

#

I will look into that, thanks!

#

btw Im gonna run migrations for the model ordering

#

nvm it does it automatically

green oriole
#

Don't forget to test your migration before committing it

#

If you have to make a second migration, delete the first one and then regenerate one

eternal owl
#

okay

green oriole
#

So we only have one migration file on the repo

eternal owl
#

okay

hardy gorge
#

How did you create the migration? Did you specify a descriptive name for the migration file?

#

You can use the --name descriptive_name_here flag

green oriole
#

Or just rename the migration file

#

But in most cases, the default message is good enough

eternal owl
#

I docker did it for me

green oriole
#

Although you should make sure you have pulled the latest changes of master or you'll have a divergent history when your PR is merged

eternal owl
#

I dint run any command

#

When starting the server, the docker runs the migrations

green oriole
#

Ah yes, but you have to create one

#

pipenv run makemigration

eternal owl
#

oh

#

will do in the end when I update my branch

hardy gorge
#

But in most cases, the default message is good enough

No, use a descriptive name for the migration, not an autogenerated one

#

That makes it much easier to read through the migration history and know what each one does

#

Renaming them manually is possible, but it gets messy if you try to do it several migration files later

#

(Since they reference each other)

eternal owl
#

okay

green oriole
#

add_jump_link_field_to_reminder for example is good enough, isn't it?

#

Yes, you can only rename if there is no migration based on this one, or you have to manually change the reference

#

But it isn't that complicated tbh

hardy gorge
#

well, yes, but it's not 0003_auto....

#

which is typically what you get if you let Django name the migration file itself

green oriole
#

I meant it is okay to left it if the default name is comprehensive enough, not those default auto migration thingys

clever wraith
#
bot/seasons/evergreen/bookmark.py:74:21: E126 continuation line over-indented for hanging indent
#

what does this mean ?

cold moon
eternal owl
#

I have the next/prev button logic working but I have one problem

#

I cant find a way to recognise which button was clicked

#

I think I found a way

eternal owl
#

Why are the corner 2 brackets blue? and for some reason it is not giving me complete data, example: if object.title = "No Image", then the value option in button is only returning "No"

clever wraith
#

@gusty sonnet I am unsure what you meant of the last comment

gusty sonnet
#

Do you know about set in python?

clever wraith
#

I tend to avoid it

#

I prefer list

gusty sonnet
#

Why is that?

clever wraith
#

list is easy to maintain

brazen charm
#

they have separate uses

gusty sonnet
#

They are both easy to maintain imo, and set is a very very strong hashtable-like collection

clever wraith
#

and most of its thing is straight forward

gusty sonnet
#

Specially in this case you only keep a collection to do membership checking

#

Then set is superior to a list in every single way

clever wraith
#

in readibility also ?

gusty sonnet
#

So do its readability and maintainability

brazen charm
#

sets are used over the place in seasonalbot and bot, not a valid point imo to not use them because they're harder to understand for you

clever wraith
#

I know and agree with that @brazen charm

#

so just replace list with sets

molten bough
#

@eternal owl you still have to surround it with quotes

#

value="{{ object.title }}"

eternal owl
#

oooh

#

it works now \o/

gusty sonnet
#

Here is a simple bechmark between list and set

#

!e ```py
import timeit
from functools import partial
import random

my_set = set(range(100_000))
my_list = list(range(100_000))

def test1(a):
"""list"""
return a in my_list

def test2(a):
"""set"""
return a in my_set

tests = (test2, test1)
length = max(map(len, (t.doc for t in tests)))

print('\n'.join(f"{test.doc:<{length}} -> {test(99_999)}" for test in tests))
run_times = tuple(
timeit.Timer(partial(test, random.randint(0, 99_999))).timeit(1_000)
for test in tests
)

fastest = min(run_times)
print('\n'.join(
f"{test.doc:<{length}} -> {run_time:.3f}s - "
f"{'Fastest!' if run_time == fastest else f'x{run_time / fastest:.2f}'}"
for test, run_time in zip(tests, run_times)
))

stable mountainBOT
#

@gusty sonnet :white_check_mark: Your eval job has completed with return code 0.

001 | set  -> True
002 | list -> True
003 | set  -> 0.000s - Fastest!
004 | list -> 0.192s - x839.77
gusty sonnet
#

You can see that the set is about 800 times faster

eternal owl
#

I wasted almost 30min searching for the thing haha, thanks @molten bough

molten bough
#

no prob

#

haha

clever wraith
#

did you just typed that code RN ?

gusty sonnet
#

I encourage questions about sets and why sets over lists @clever wraith - a simple so just replace list with sets makes it feel like you are being forced to - I am just suggesting things that can make your code better

#

I have a template to benchmark functions

#

So yes I just typed that code

clever wraith
#

ahh nice , i am not saying that in that case

#

i am asking to minimize commits

#

so that i don't left anything beside

hardy gorge
#

I'm mainly confused by the readability argument here. Why would a list be more readable than a set?

#

They're both basic, built-in data types that have nearly the same API in terms of what we want to do.

#

It's just that one of them is made for the job while the other is not.

clever wraith
#

I am pretty unfamiliar so add 10 minute delay in the commit please

#

@gusty sonnet

    sent_person = set(ctx.author)  # list of id who got the message
TypeError: 'Member' object is not iterable
#

ok so make a set

gusty sonnet
#

You either do py sent_person = set() sent_person.add(ctx.author)or you dopy sent_person = {ctx.author}

clever wraith
#

and then add it ?

#

yeah i said right

brazen charm
#

same as with a list

gusty sonnet
#

When you do set(ctx.author) it will try to convert ctx.author to a set

#

Similar to calling list(ctx.author)

clever wraith
#

ahhh ok

gusty sonnet
#

And will raise the same exception

#

In this case py sent_person = {ctx.author}will do, just like how to do the list

#

To emphasize on it being a set, you can do py sent_person: typing.Set[discord.Member] = {ctx.author}

clever wraith
#

Done
commiting

#

it was 2 line change ;-;

gusty sonnet
#

It was, but the performance is about 800 times faster

clever wraith
#

so while in check i have to convert it into list right

gusty sonnet
#

You do not have to convert anything to a list

clever wraith
#
                and user not in list(sent_person)```
gusty sonnet
#

A simple user not in sent_person is fine

clever wraith
#

I miss understood the previous error

eternal owl
#
def save(self, *args, **kwargs):
        title = self.title.capitalize()
        super(Tag, self).save(*args, **kwargs)```
hey @molten bough , I am trying to overwrite the save method to make sure the title always starts with caps or else the ordering messes up, but its not working, what did I do wrong
molten bough
#

it's just super().save(*args, **kwargs) I think

#

you have a python 2 style super call

eternal owl
#

ops

#

does not work still

#

maybe it should be self.title = self.title.capitalize()
edit: works now!

gusty sonnet
#

You should also change the comment to match the type @clever wraith

#

Right now it's # list of id who got the message

brazen charm
#

I'd assume it gets the values from the instance, definetly won't see your random title var

clever wraith
#

are we gonna reach 100 comments this time ?

eternal owl
#

Now I will have to grey out the next button when it reachs final tag and grey out the prev button when its the first tag, need to figure out a way

clever wraith
#

oh man its gonna be laggy experience for users like me

eternal owl
#

the website?

clever wraith
#

even if its only text

#

yes

eternal owl
#

how so

#

the video quality is just bad

clever wraith
#

refreshing pages

#

re rendering things

eternal owl
#

yeaa....I have 0 knowledge of js to use ajax 😓

#

I think someone can help me out with that

clever wraith
#

i have that in negative

eternal owl
#

If anyone knows js and can help me render a page without refreshing, do ping me @

cold moon
#

When will my SeasonalBot PR be reviewed?

green oriole
#

Ajax would be pretty overkill for tbis task I think

#

Some day

gusty sonnet
#

Ah, which one are you doing @cold moon can you link it again

eternal owl
#

It probably wont be overkill if we have lot of tags

green oriole
#

Two reviewers should have been assigned to your PR

#

I’d be happy to review it myself, buy it seems like our review doesn’t really count now >.>

eternal owl
cold moon
green oriole
#

Nah, using Ajax isn’t needed, even if you want to read all the tags, you aren’t going to spam the next button

gusty sonnet
#

Gotcha! I will open it and do a test run tomorrow

eternal owl
#

okay

clever wraith
#

can't for merging of mine

#

NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO

green oriole
#

?

clever wraith
#

I forgot to add a . in one of the message

green oriole
#

Which message?

clever wraith
#
description=f"{ctx.author.mention}, please enable your DMs to receive the bookmark",```
#

there is no .

#

its old btw

#

should i do another commit doing it ? or maybe if in future i do something i will snug it in there

green oriole
#

Have you pushed yet?

clever wraith
#

i commited

#

its yet to be merged

green oriole
#

You can amend it to the latest commit

clever wraith
#

how ?

green oriole
#

Add the dot and then git commit --amend --no-edit

#

After stashing the file (using git add)

#

@cold moon what happen if you launch the bot without the api key env var? Does the bot still start, even the cog can’t be used?

clever wraith
#

i need to learn git , but yeah commited it

green oriole
#

Nice

#

I read the pro git book to learn more about git

#

You have to be motivated tbh, but I think it is worth reading

clever wraith
#

there is a book on it

#

book on a software ?

green oriole
#

Yes

clever wraith
#

will get it for my kindle

green oriole
#

It is free, I actually read it on kindle

#

There are books on everything

cold moon
#

@green oriole For me this works, just this throw error when trying to use command

eternal owl
green oriole
#

Okay great ks

eternal owl
#
    def get_object(self, *args, **kwargs):
        """Get Tag model obejct using the title or show 404 page if object does not exist"""
        title = self.kwargs.get("title")
        return get_object_or_404(Tag, title=title)```
what can be return type for this?
molten bough
#

whatever get_object_or_404 returns - probably a Union[Tag, Reponse] but double-check

eternal owl
#

oh okay

#

I dint know we could do Union n stuff haha

green oriole
#

You also have Optional and some funny stuffs like that

eternal owl
#

oh

#

btw what all devops tools are we using for the site/bot.

#

other than docker

glass pecan
#

in what context

green oriole
#

How the production environment is deployed?

eternal owl
#

yea

molten bough
#

I think it's salt

#

mostly

green oriole
#

For the most part yeah iirc

hardy gorge
#

There's quite a bit to it, ranging from the CI automatically building and pushing images to docker hub to salt making sure it gets deployed

glass pecan
#

Repo: Github -> CI: Azure Devops -> Docker Hub -> VPS: Saltstack Webhook -> Docker Pull and Deploy

hardy gorge
#

Scragly knows far more about the process than I do, though, so he's probably writing a killer message

eternal owl
#

wow

#

cool

molten bough
#

It's not super complex, but there are a few moving parts

eternal owl
#

Which one should I start learning

glass pecan
#

github

eternal owl
#

What else is there in github to learn other than daily stuff

green oriole
#

Docker probably

#

It is pretty widely used now

eternal owl
#

okay

molten bough
#

I'd say CI

#

It's very useful even outside of deployment

eternal owl
#

oh

glass pecan
#

if you just generally want to learn, CI is next after github yeah.

hardy gorge
#

Configuring GitHub, protected branches, getting experience with the entire routine of pull requests -> reviews -> merging

#

Then maybe a simple CI with checks for GH

eternal owl
#

okay

hardy gorge
#

Which could just be GitHub actions with flake8

glass pecan
#

Github Actions specifically is what i'd be suggesting, yeah

molten bough
#

GH actions feels a touch lacking imo, but it's quite capable

glass pecan
#

it's pretty good

hardy gorge
#

It's probably what we'd use if it was available when we started

glass pecan
#

it's only growing really

#

plus it has some triggers azure doesn't

green oriole
#

I recently started with Actions, it is pretty straitforward to use, but the docs are kind of meh

glass pecan
#

the rest can be coded

green oriole
#

It isn’t to late to switch

hardy gorge
#

Sure, but it's work

glass pecan
#

there's no need to switch

molten bough
#

I have a project that actually can only be built on azure haha

glass pecan
#

what we have works fine now

molten bough
#

since it needs the extra RAM

green oriole
#

Yes true

glass pecan
#

there's no real need to change a stack unless there's a feature missing or it costs us unnecessarily

hardy gorge
#

We've discussed it a couple of times (as in, it has come up since GH actions became a thing), but there's no pressing need to change atm

glass pecan
#

azure doesn't cost us and it doesn't have any missing features

green oriole
#

But I feel like the extra integrations with github is worth switching

molten bough
#

It does integrate

glass pecan
#

azure has it's own featureset

eternal owl
#

I have github student pack, I think it gives me lot of free stuff

molten bough
#

Actions is already free

green oriole
#

Yeah, you can have github pro free and the jetbrain suite free too

glass pecan
#

afaik only something like release triggering is missing from integrations in azure, which is in actions.

#

but we legit don't use releases in any of our bots or the site

#

if we do use releases, you'll actually see we use Github Actions for it (like some of the libs)

green oriole
#

But you can click on discord webhook message with Actions

molten bough
#

You mean triggering a release pipeline?

hardy gorge
#

Yes, that's true. We do use GH actions for things like flake9-annotations

#

flake8, but you get the idea

glass pecan
#

flake9 lol

eternal owl
#

I have another question regarding rest API( As I almost finished the tutorial on the official website)

glass pecan
#

better, faster

molten bough
#

Flake VIII-2

hardy gorge
#

now, with more flakes

molten bough
#

Azure does have release pipelines, though

glass pecan
#

mmm flakey

#

no, the opposite gdude

eternal owl
#

So we use rest API to access/modify a database? or is there anything else to it?

molten bough
#

Oh, triggering a pipeline when a release is published to GH?

glass pecan
#

if you create a github release tag, azure won't trigger

molten bough
#

Right, right

green oriole
#

You can use whatever you want with the rest framework

glass pecan
#

there's external things you could do to make it do so, but actions has that built in

molten bough
#

And then you take the tag and release it to PyPi

glass pecan
#

yep

#

exactly

molten bough
#

Not a bad idea

glass pecan
#

we use it for annotations

#

i created a similar thing for a few other projects too, non-pydis

green oriole
#

We use it to trigger db queries, but you can do whatever you want

hardy gorge
#

@eternal owl Our Django project manages the database, entirely. It has an API so the bot can communicate with it to get/post/patch/put information.

eternal owl
#

okay

#

can you give me example of whatever @green oriole

glass pecan
#

sounds a bit broad of a thing to give a specific example for lol

green oriole
#

It is python code, you can really do whatever you want like, I don’t know, trigger a deployment for example, to stay on context

eternal owl
#

@hardy gorge why dont we allow the bot to access the database insted of sending a request to the rest api and then indirectly interacting with the db?

glass pecan
#

this was a decision from before ves and I were around

#

but afaik it was to avoid having to maintain identical codesets for interacting with the db and models

molten bough
#

precisely

glass pecan
#

why bother doubling up

molten bough
#

I was there for that discussion

#

If we didn't do that, we'd have had to have maintained sqlalchemy models separately or something like that

#

super restricting

#

I also had the intention of providing some public APIs but that never panned out

glass pecan
#

probs for the best

eternal owl
#

I dint understand anything you guys said

#

😅

green oriole
#

Having only one database in the site is easier than two, one for the site, one for the bot

hardy gorge
#

It's also typically recommend for Django projects to let Django have full control over the database, but we obviously didn't use Django back when the architecture was determined.

molten bough
#

Yep, that was the ol' frankenflask site

glass pecan
#

yeah. now that we do use django, it still makes sense, if not moreso since we can't just copy the models using django orm to bot

molten bough
#

even if you could, you'd have to figure out how to synchronise migrations

eternal owl
#

oooh so the db wasn't designed using sql but through django orm, i get it now

glass pecan
#

there's really no need for our botto to have db access

#

we can, at any time, add a persistant sqlite db if we're in need for an sql db in the bot that doesnt interact with the same models as site

green oriole
#

The only upside of having a bot only db is that you only have to make one PR when you have to create a new model

glass pecan
#

like i said, we can do that anytime with sqlite

eternal owl
#

okay cool

glass pecan
#

just look at seasonalbot, it does this already

molten bough
#

To be fair, having the django admin to manage everything as well is handy too

glass pecan
#

django admin is nice, yeah

hardy gorge
#

The downside is that we wouldn't have a web app front-end

green oriole
#

There is an sqlite db on seasonal?

glass pecan
#

esp with oauth permissions now working

#

there's a number of persistant data files on seasonalbot

molten bough
#

Who's in charge of the API at the moment, by the way?

glass pecan
molten bough
#

I remember Volcyy was in charge of it but I haven't seen him in forever

glass pecan
#

core devs, collectively, gdude

eternal owl
#

we might need sqlite db for @dusky shore

glass pecan
#

nothing is changed on a whim

green oriole
#

Yes, I know that, I just didn’t know that they were a sqlite db

glass pecan
#

@eternal owl look at the link i sent above

molten bough
#

Steering committee

#

:>

eternal owl
#

datafile is something like json file?

green oriole
#

Whatever file format you want

#

Could be json, csv, sqlite..

eternal owl
#

okay

#

what is data directory

glass pecan
#

atm most of the are plain ol' json. but there's been at least one sqlite file in the past (egg hunt) and there's another coming up

green oriole
#

The place where the file is stored I think

eternal owl
#

oh

green oriole
#

There is no docstring?

glass pecan
#

what do you mean

eternal owl
#

Copy datafile at the provided file_path to the persistent data directory.

green oriole
#

Hmm

glass pecan
#

yes, you can also just read the code

#

as it says exactly what it does

eternal owl
#

okay

green oriole
#

A directory that resist to salt redeployment

glass pecan
#

yes, to be exact it's a mapped volume that lives on host

#

same as the data directory for our database

#

we can redeploy the db container as many times as we want, but the data volume gets attached afterwards each time, keeping the original data

green oriole
#

Is it a linode block storage?

glass pecan
#

no

eternal owl
#

This can help for the quiz game also

glass pecan
#

i don't see how

#

quiz answers are static

molten bough
#

you wouldn't really use block storage unless you were using something like kubernetes or a CDN

eternal owl
#

scores

green oriole
#

So you can’t like, detach the block and reattach it to another instance if the main instance fails?

eternal owl
#

.quiz leaderboard

glass pecan
#

not sure if a quiz leaderboard is really needed, but it's on the right track for suitable uses

eternal owl
#

okay

glass pecan
#

really it would be better if the quizes had more content and variety added instead

eternal owl
#

yeaa..we have only 30q so far

glass pecan
#

since that takes more effort and time, it's pretty important to chip away at it over a longer period of time

eternal owl
#

Ves mentioned a feature where we can add new questions using a command

green oriole
#

It would he cool to alsp have various topics

glass pecan
#

if that's the case, then the questions wouldn't be static and they'd have to use a persistant data file

#

however it's likely to be something only usable by staff, due to the ease of abuse

hardy gorge
#

I'm not sure if a command is really the easiest way to add answers/questions and I wouldn't want such a feature to be exposed to all members anyway

glass pecan
#

yeah

#

it's very hard to review them in full that way also

molten bough
#

it's kind of a shame that the site connection has a long setup process

eternal owl
#

If you ask me, finding a good quiz api which can get us 1000s of questions without us breaking a sweat

molten bough
#

if it was easier or automatic then maybe it wouldn't be too awful to have seasonalbot use it

glass pecan
#

it's not worth relying on an external api though

#

site connection?

molten bough
#

Well it'd be the easiest way to manage the quiz questions

glass pecan
#

i don't see how it's easier than just using an sqlite or json file though

hardy gorge
#

The only difficulty I can see is the complication of local set-ups

molten bough
#

unless the bot had an exposed api instead, and the site connected to it

#

I'm thinking from a UX perspective

glass pecan
#

which user are you talking about

#

since members who use the command won't even notice the difference

molten bough
#

Whoever is managing the questions

mellow hare
#

I think you're adding layers of complexity to this that don't really need to be there for this kind of project

green oriole
#

Ah, to use the admin portal?

#

Would be a lot of work just for that

glass pecan
#

hmm, dunno. a collection of json files are pretty simple to go through in reviews.

mellow hare
#

And just as easy to update

molten bough
#

Yeah, true I guess

eternal owl
#

Should I open an issue for discussion on how we are gonna add questions and of which type?

green oriole
#

But nobody really suggest questions so..

molten bough
#

I mean, a lot of seasonalbot features are fire-and-forget, yeah

mellow hare
#

That's a big point of it

glass pecan
#

up to you iceman. it's a pretty low priority thing, but if the quiz gets worked on again, content should probably be the first focus

molten bough
#

Yup

eternal owl
#

tbh activity of seasonalbot contributors has come down

mellow hare
#

Simple projects and fun for new users to learn how to do cool stuff and contribute to their community

green oriole
#

Hey, hacktoberfest

#

Contribs in general have dropped

eternal owl
#

yea

glass pecan
#

we just went through Christmas, New Years, January holidays and starting of school

green oriole
#

Plus the beginning of the year is a pretty busy time

glass pecan
#

ofc it's lower at this time of the year lol

mellow hare
#

School's the major contributing factor I think

glass pecan
#

this is a common cycle at any rate

mellow hare
#

We have a significant number of school age users

glass pecan
#

yeah

eternal owl
glass pecan
#

plus if they aren't, they are often parents

eternal owl
#

Im in high school @mellow hare

hardy gorge
#

I'd say the activity levels are fine and there are quite a few major projects planned for 2020

mellow hare
#

Yep

hardy gorge
#

There's plenty to do for the group of people we have

green oriole
#

I mean, there are always some core devs ready to contribute, that’s why you have some major projects planned

glass pecan
#

my major project is || REDACTED ||

mellow hare
#

always ready to contribute
Tax season

hardy gorge
#

Sure.

mellow hare
#

I'm barely ready to live

glass pecan
#

yeah all of us have availability times in real life that's different from each other.

#

we're not always at the ready 😄

#

if we have a few core members missing, it can greatly put some things off for a while

#

which is fine, it's part of the deal

green oriole
#

Plus most of the core devs doesn’t sleep, it helps a lot 😄

glass pecan
#

haha

mellow hare
#

True

eternal owl
#

how manys hours of sleep do you get scragly

molten bough
#

not enough

glass pecan
#

usually 10 hrs a day

mellow hare
#

That's your average

eternal owl
#

I dont think so pithink

mellow hare
#

I've seen it vary from 2 to 16

glass pecan
#

yes it's my avg

eternal owl
#

wow 😂

glass pecan
#

i always catch up if i go without a while

molten bough
#

I try to get 7

#

haha

green oriole
#

Well, 2h one day, 16h the following day 😄

glass pecan
#

pretty much

#

hems not joking when he said 16

#

also the times when i sleep are all over the place

hardy gorge
#

I try to get 8, it usually becomes 7, sometimes 6.

eternal owl
#

how is it possible?16 hours? do you take sleep breaks?

glass pecan
#

that's kinda the main reason why it feels like i might be "always" around

hardy gorge
#

My alarm goes at the same time every weekday, so that makes it easy. If I want 8 hours, I should be asleep by 10PM

green oriole
#

Is it like, 10h in a row or just 10h in the day?

glass pecan
#

10h in a row usually, by avg

molten bough
#

I've slept for 16 hours before

glass pecan
#

once im asleep, i won't wake back up until i'm good again

molten bough
#

Where's my bucket

woeful thorn
#

unless someone pings you

glass pecan
#

lol

eternal owl
#

i dont understand how pings wake you up

glass pecan
#

that's true, i've been pingarood and i was light enough sleeping i had a look into it

woeful thorn
#

(It's a joke)

glass pecan
#

but that's rare

#

super rare

molten bough
#

you mean, you don't put your phone next to a megaphone at night?

glass pecan
#

lol no need when its on full volume because i need my 12 alarms to get me up for a job

molten bough
#

haha

woeful thorn
molten bough
#

hahaha that exists

eternal owl
#

jeez

green oriole
#

I know some people that can be woke up just by the vibration of the phone

glass pecan
#

ela has that on hand because he owns it

green oriole
#

So yeah

eternal owl
#

he?

green oriole
#

He just took a picture haha

woeful thorn
#

I am, surprisingly, not taylor swift

mellow hare
#

WHAT

molten bough
#

haha

glass pecan
#

how unfortunate

eternal owl
#

How old is that taylor swift gif

mellow hare
#

And here I thought I was supporting you by buying so many of your albums

glass pecan
#

lol

molten bough
#

"Look what you made me do"

#

anyway

#

I always found it funny that while I was on staff I always had like, massive grandiose plans for the site and the rest of you were like HOLD UP THERE A SECOND

eternal owl
#

any plans of returning to the staff role @molten bough ?

molten bough
#

I would've made it so much more complicated if I'd had the chance probably haha

#

you and I both know that's not how staff works, haha

green oriole
#

Meh, Taylor swift isn't even a python dev, I'm disappointed

eternal owl
#

u had owner role before?

molten bough
#

but no, not really

eternal owl
#

okay

#

I really liked ur old profile pic, that dancing pony

molten bough
#

Wasn't it a pony licking the lens of the camera?

#

Anyway, getting off-topic

eternal owl
#

I think I am ready to make a PR for the tags issue (site repo)

molten bough
#

\o/

eternal owl
#

\o/

#

did u see the vid?

green oriole
#

\o/

molten bough
#

I didn't

eternal owl
#

see it

molten bough
#

and that link doesn't work for me

molten bough
#

Stop feeding your mouse speed

#

haha

#

Looks good though

eternal owl
#

thanks

#

is the text fine in the tags page?

#

below the tags heading

#

it says Use this feature through the @python-discord bot. The following are the tags that are currently available:

molten bough
#

that was an interesting code block

#
You can make use of tags using <code>!tag &lt;tagname&gt;</code> on Discord. The following tags are available:
#

I'd say something like that

eternal owl
#

okay

eternal owl
#

How often do you guys have staff meeting

glass pecan
#

once a week

eternal owl
#

Okay

glass pecan
#

why

eternal owl
#

Nothing, just wanted to know

cold moon
#

I fixed now my PR (.movies command, moved genres to if-elif-else statement from subcommands)

gusty sonnet
#

Hmm, I recommend a dictionary for this case, since only some arguments to be passed into get_random_movies will be changed basing on genre

green oriole
#

@cold moon you shouldn't use that amount of if/elif, you should generate the argument dynamically

gusty sonnet
#

So you can do something like this

#
await get_random_movies(self.http_session, amount, *MOVIES_INFO[gerne])```for example
#

Without having to have 20 different if else

#

It will make it very easy to modify this list ( add / remove genres for example )

cold moon
#

Oh, OK, I'll fix

gusty sonnet
#

Or you can simply make an Enum in this case even

#

Since it's a simple genre -> number

#

An Enum will be much better than a dictionary

#

Like this

#

!e ```py
from enum import Enum

class MovieGenre(Enum):
Action = 28
Adventure = 12
Animation = 16

for genre in ('Action', 'Adventure', 'Animation'):
print(genre, MovieGenre[genre].value)```

stable mountainBOT
#

@gusty sonnet :white_check_mark: Your eval job has completed with return code 0.

001 | Action 28
002 | Adventure 12
003 | Animation 16
gusty sonnet
#

It is nicer than a dictionary in this case I believe

cold moon
#

Okay

green oriole
#

For the second part of the command you can simply use genre.title()

eternal owl
#

Can I use docstrings between the functions as well or just single line comments?

mellow hare
#

Doc strings are comments

#

If you feel it's needed, go for it

eternal owl
#

Okay

cold moon
#

Done!

eternal owl
#
# ----------------------------------------
"""
The below line is required or else the `get_context_data()` method will fail
when ever there is a post request.

Reason:
The source code for `get_context_data()` uses self.object which is declared in `get_object()`.
When there is a POST request, the `get_object()` is not being called hence the below code.
"""
self.object = obj
# ----------------------------------------```
is this good enough @mellow hare
#

a docstring for just 1 line of code

woeful thorn
#

Are these lines added by pycharm? # ----------------------------------------

eternal owl
#

no I added those

woeful thorn
#

Do you intend to keep them in the code that gets merged?

eternal owl
#

Looks clean, distinguished

woeful thorn
#

It doesn't

mellow hare
#

When it comes to stuff like that, stick with the style of the rest of the repo

eternal owl
#

okay

woeful thorn
#

For the comment itself, it's fine but it seems overly verbose

eternal owl
#

pithink I will try to shorten it

gusty sonnet
#

Hmm when I use the command I got a py seasonalbot | 02/14/20 21:15:19 - bot.seasons.evergreen.movie WARNING: There was KeyError while executing HTTP request. API may down or API key may be incorrect, however, some movies have some missing fields, and this error will raise this too. Problematic Key: seasonalbot | \'title'``````

#

@cold moon it works normally from your side right?

brazen charm
#

that error message seems a bit verbose

gusty sonnet
#

It is, hmm

#

idk if it's from me

#

Yeah I keep getting the error

#

I guess I'll investigate it tomorrow

#

Here we go

#
seasonalbot    | Traceback (most recent call last):
seasonalbot    |   File "/bot/bot/seasons/evergreen/movie.py", line 108, in get_random_movies
seasonalbot    |     movie_text += f"**{movie_data['title']}**\n"
seasonalbot    | KeyError: 'title'```
#

movie_data is py {'status_code': 7, 'status_message': 'Invalid API key: You must be granted a valid key.'}

#

Am I missing something?

rocky bloom
#

maybe the API key's expired or something?

#

or you've misconfigured your API key

#

TMDB_API_KEY = environ.get('TMDB_API_KEY'

clever wraith
#

@glass pecan may i ask why you suggested using contexlib to suppress a exception rather passing it ?

cold moon
#

Should I move get_random_movies to multiple functions inside of Movie cog, and use them inside command?

cold moon
#

Can anyone re-review my PR?

clever wraith
#

merge ?

hardy gorge
#

@clever wraith It's more explicit: If you're just using:

try:
    something
except SomeException:
    pass

you are suppressing it. The contextlib does that explicitly by giving you a context in which that exception will be suppressed.

clever wraith
#

so i think its done. can we merge it ?

cold moon
#

And also may now my PR get merged?

woeful thorn
#

Have some patience please.

clever wraith
#

ok

valid quest
#

@tawdry vapor Thanks 😄

tawdry vapor
#

You're welcome.

valid quest
#

Now i will be able to contrib also, cool 🙃

#

Whoop, ive setup my webhooks and channel ids properly, is that should be a problem?

hollow lichen
#

@valid quest No

valid quest
#

Hmm well then

hollow lichen
#

If you build the bot with the website it will fix it

tawdry vapor
#

It could be indicative of the connection to the site being misconfigured.

valid quest
#

Already did @hollow lichen

tawdry vapor
#

Do you see an exception in the logs?

valid quest
#
Traceback (most recent call last):
bot_1       |   File "/bot/bot/cogs/defcon.py", line 66, in sync_settings
bot_1       |     response = await self.bot.api_client.get('bot/bot-settings/defcon')
bot_1       |   File "/bot/bot/api.py", line 93, in get
bot_1       |     await self.maybe_raise_for_status(resp, raise_for_status)
bot_1       |   File "/bot/bot/api.py", line 83, in maybe_raise_for_status
bot_1       |     raise ResponseCodeError(response=response, response_json=response_json)
bot_1       | bot.api.ResponseCodeError: Status: 401 Response: {'detail': 'Invalid token.'}
#

Yeah, i can see

hollow lichen
#

Ah ok, then there’s a problem somewhere 😉

valid quest
#

Feb 15 21:21:32 Bot: | bot.api | WARNING | Cannot send logging record to the site, got code 401.

tawdry vapor
#

Are you using Docker for both?

valid quest
#

Yeah

#

bot_1 | Feb 15 21:21:32 Bot: | bot.cogs.watchchannels.bigbrother | ERROR | Failed to fetch the watched users from the API

#

I also get alot of 401's

tawdry vapor
#

Those are all related. The API token is incorrect so they're probably all 401s i.e. failure to authenticate

valid quest
#

Yeah, i will check that

tawdry vapor
#

I believed the token did not require your attention when you're using Docker for both

valid quest
#

Which token is it?

#

Hold on

#

Yeah, well, the dumbest man award goes to @valid quest

#

But it says there it is given automatically

tawdry vapor
#

Yeah it should be

valid quest
#

So leave it blank?

tawdry vapor
#

Just don't include it at all.

valid quest
#

Again

#

Mm

#

Weird

tawdry vapor
#

You're using docker-compose up to start both right?

#

As in, one command starts both services

valid quest
#

Yeah

tawdry vapor
#

Maybe something is broken then. The key should be automatically given

#

The site may not be creating the user properly.

valid quest
#

Could be

tawdry vapor
#

Seems like it. I'm looking at it right now and the logic doesn't really make sense

valid quest
#

Ill look at the steps again to make sure i did all correctly

#

Oh, it seems like its running

#

One last warning is - @Admins WARNING: Unable to get DEFCON settings!

#

bot_1 | Feb 15 21:36:08 Bot: | bot.api | WARNING | Cannot send logging record to the site: ClientConnectorSSLError(ConnectionKey(host='api.web', port=8000, is_ssl=True, ssl=None, proxy=None, proxy_auth=None, proxy_headers_hash=-3725913974811621246), SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1076)'))

#

web_1 | You're accessing the development server over HTTPS, but it only supports HTTP.

#

Oh yeah

#

Got the problem

#

Great! everything works fine

tawdry vapor
#

@glass pecan Can you provide insight into what's going on with manage.py? The logs output nothing after "Watching for file changes with StatReloader", which I guess is part of "Collecting static files.". So I don't see "Starting server." or any of the logs from create_superuser() - is that even being called?

valid quest
#

Sorry for my dumb moment

tawdry vapor
#

So how did you fix the token issue?

valid quest
#

I made sure everything was ok and i found a missing conf

#

Now everything works fine 👍

#

The initialization and instructions were very friendly i must say

glass pecan
#

@tawdry vapor whats the context?

tawdry vapor
#

Just when using it to run the server, specifically in debug mode via compose

glass pecan
#

just normally?

tawdry vapor
#

Yeah

#

I don't get why the logs just disappear towards the end.

#

The web server still goes up of course

glass pecan
#

yeah i've noticed in the past there's missing output but hadn't had time to look into it. i can kinda remember though that my thoughts were along the lines of "this is something weird specific to running through the development server"

#

prints don't print, certain logs don't log, etc

tawdry vapor
#

I was trying to debug the token issue mentioned above but noticed that even on my own machine, I can't see the logs from create_superuser which are useful cause it prints out the token it uses.

#

Well, at least nice to know I am not blind or crazy

glass pecan
#

true, and i think it was when i was working on the bot token thingo i noticed the same thing

#

i can have a brief look sometime today, i just got out of bed though

tawdry vapor
#

Good morning 🙂

glass pecan
#

lol, g'morning

tawdry vapor
#

I'll make an issue actually

glass pecan
#

probs a smart idea

tawdry vapor
#

Just for record keeping and not forgetting

glass pecan
#

@tawdry vapor can you test something for me

valid quest
#

sorry to interrupt, you guys have any suggested open issues to work on? I have experience with discord.py and asyncio

glass pecan
#

if it's your first time contributing with us, i'd suggest looking at open issues on SeasonalBot

valid quest
#

Sure, thanks

tawdry vapor
#

What do you need? @glass pecan

glass pecan
#

practically all of them sans the issue for stripping the season structure from the bot is available for anyone

#

@tawdry vapor can you add a line to your compose and rebuild/run?

brazen charm
#

I recently unassigned myself from one on the bot, which is supposed to be an easier one. But the seasonalbot's are more suited for beginners

glass pecan
#

if you unassiged, did you comment on it to say so?

brazen charm
#

Yes

glass pecan
#

coolio, just had to check as we don't get notifications via email otherwise

tawdry vapor
#

What line?

glass pecan
#
services:
   web:
     tty: true
#

the tty one

#

and see if it lets the output appear

tawdry vapor
#

Yeah, it does.

glass pecan
#

nice

woeful thorn
#

Oh, there’s an actual reason why print statements don’t appear? I thought I was just losing my mind

tawdry vapor
#

We all were 😄

glass pecan
#

then it's related to the python logging module

#

running it through docker makes it think its running like a service instead of through a terminal

#

so it obvs (not fucking obvious to me until now) removes certain unnecessary output

woeful thorn
#

Does that just affect the site?

glass pecan
#

tty just tells it it's a terminal

#

technically it can impact anything we run through docker in development mode and that we use the py logging module with

woeful thorn
#

Ah, ok

patent pivot
#

👀 well that is interesting

glass pecan
#

but i don't think i've noticed much when running bots through it the same way

woeful thorn
#

I was seeing it with bot earlier but it was intermittent

glass pecan
#

then i guess we should add it by default for dev composes

woeful thorn
#

I figured it was windows being windows

#

Or something

glass pecan
#

that would have been a fair thought lol

tawdry vapor
#

🤔 I did notice some warnings not appearing but I don't know if that was related

#

Like warnings warnings, not log warnings

glass pecan
#

yeah

#

i guess it's specific to stdout, stderr still works

tawdry vapor
#

Never mind, I don't run bot with Docker so that couldn't be the cause

glass pecan
#

i never remember which one warnings use though

#

i hate warnings as i'm not a lib dev lol

tawdry vapor
#

It's something else. Some warnings appear, others don't

#

I just used logging in the end

glass pecan
#

makes sense

#

guess we should add the tty info to the issue

cold moon
#

Should SeasonalBot have Wikipedia search?

clever wraith
#

not actually neede

hardy gorge
#

It's been discussed before; I'm not sure what the conclusion was.

#

Is there an issue for it?

gusty sonnet
#

iirc there was a PR / someone who wants to do it

#

It was originally a suggestion for @stable mountain

hardy gorge
#

Okay, cool. There's an issue, someone has expressed interest, but as far as I can tell, no PR has been made.

#

I'll ping them in the issue and otherwise someone else can pick it up

green oriole
#

Well, that's kind of fun

#

!e```

stable mountainBOT
#
Did you mean ...

enumerate
except
exit()

green oriole
#

If you forget the space

gusty sonnet
#

Can't you do that with a simple !e

#

!e

stable mountainBOT
#
Command Help

!eval [code]
Can also use: e

*Run Python code and get the results.

This command supports multiple lines of code, including code wrapped inside a formatted code
block. We've done our best to make this safe, but do let us know if you manage to find an
issue with it!*

gusty sonnet
#

Uh huh

#

Accidental feature? lol

green oriole
#

I guess haha

#

Everything is FEATURE

gusty sonnet
#

😄

green oriole
#

Haha, that's a great one

valid quest
#

hey there guys, I need to create a branch for my issue pr?

green oriole
#

Yep

valid quest
#

Thanks, it just seems there are no Branches, so i tought its wrong to open one

cold moon
#

I want help with Bot and Site too, but my biggest problem is setting everything up...

green oriole
#

You have to create a branch from master and then PR to master

valid quest
#

Yeah, ive read that, just

Thanks, it just seems there are no Branches, so i tought its wrong to open one
Confused me

green oriole
#

You are working on the pydis repo, right ?

#

@cold moon we can help with that :D

cold moon
#

I mean, I can't currently get access to my Linux computer and I really don't want to set webserver up in Mac... I did this one time and this was nightmare.... All these verifications etc...

sullen phoenix
#

setting up docker on windows was a pain for me, so it’d probably be even worse on mac

valid quest
#

Oh :(

cold moon
#

It's easiest in linux

valid quest
#

Not good for me

hardy gorge
#

I don't think docker on mac is a nightmare

#

It's particularly Windows Home that's a pain

patent pivot
#

it's not great on mac

sullen phoenix
#

you can't even run docker on windows home

#

you have to have windows pro

patent pivot
#

it runs alright but it is a gigantic memory hog

#

hyperkit memory leaks like a bucket with no bottom

green oriole
#

Windows home isn't a pain, it just doesn't work

#

No HyperV, too bad

gusty sonnet
#

@valid quest can you rename the commit? It's a fix to the general pagination of the bot in general, so it'll be a fix for anything that'll use bot/pagination.py not just reddit

valid quest
#

Oh yeah. sure

green oriole
#

BTW, it would be great if you can avoid to put hash symbols in your branch name, because if you try to check out the branch on Linux, bash consider everything after the hash as a comment. It isn't too bad, since you only need to add quotes around it, but it can save some hairs to some reviewers :D

#

What is pydis cloud?

molten bough
#

The cloud in that logo is very low res compared to the rest of that logo

hardy gorge
#

It's something we use to share files internally

molten bough
#

Oh, nextcloud instance I guess

hardy gorge
#

yes

molten bough
#

Decent software

#

Slow, but great

hardy gorge
#

I have yet to use it

molten bough
#

It's kind of like having your very own dropbox

#

complete with calendars, notes, all that fun stuff

hardy gorge
#

Yeah, I was just browsing it for a minute but Scrags and Lemon are still setting some stuff up I think, so I'll check it out more thoroughly later

valid quest
#

@green oriole Sure, just saw this style in another branches, my bad

molten bough
#

I also do that for issue numbers actually

#

although I don't use git cli so I guess I never thought of it

green oriole
#

I used to do that, and I made mark loose half an hour, so yeah :D

#

Sorry mark

eternal owl
#

git fetch upstream
git pull upstream/master
will these 2 commands update my branch?

green oriole
#

I think so

#

But why don't you work on the upstream directly?

eternal owl
#

I just need to update my gitignore file to include .vscode

#

I din't know I could do that 😅

cold moon
#

Quick question: what is requirements to get Contributor role?

molten bough
#

Get a PR merged

cold moon
#

OK... I got one approve for my PR. Waiting second

green oriole
#

Sometimes more than one

molten bough
#

Just be patient

valid quest
#

Oh one? lol

#

Cool

patent pivot
#

depends on the content of the PR really, we don't give contributor away for one-line changes so it's case by case, but it often is a few PRs merged

eternal owl
#

any git guis you guys can recommend for linux?

molten bough
#

pycharm has a nice one

#

VS code also has one

#

I think you use at least one of those already

#

haha

patent pivot
#

gitkraken is nice for standalone if you don't want to go down the integrated route and are satisfied with your editor

eternal owl
#

I am using vs code

patent pivot
#

also to be honest git log is nice

molten bough
#

gitkraken is nice, but I've had it break too many repos to recommend it

eternal owl
#

can I use git add -i in vs code gui?

molten bough
#

also I think they still require you to make an account

#

git add -i? add has an interactive mode?

eternal owl
#

yes

patent pivot
#

yeah

molten bough
#

I don't see why you'd need something like that in something like an IDE though

eternal owl
#

I made a mistake of not commiting on the go so I will commit small chunks fo code(leading to many commits)

molten bough
#

surely you'd just mark the files you want to add to the commit from the file tree

patent pivot
#

I've mainly used -p:

       -i, --interactive
           Add modified contents in the working tree interactively to the index. Optional path arguments may be supplied to limit operation to a subset of the working tree. See
           "Interactive mode" for details.

       -p, --patch
           Interactively choose hunks of patch between the index and the work tree and add them to the index. This gives the user a chance to review the difference before adding
           modified contents to the index.

           This effectively runs add --interactive, but bypasses the initial command menu and directly jumps to the patch subcommand. See "Interactive mode" for details.
#

it's nice as heck

molten bough
#

I dunno, I don't use git CLI

eternal owl
#

so I can commit small chunks of code?

#

using -p

molten bough
#

I guess that's probably like pycharm's checkbox feature

#

you can pick which chunks of code in a file to add to a commit

green oriole
#

It is -i for small part of code

eternal owl
#

okay

patent pivot
#

@green oriole no it is -p as well

#

-p just skips the introduction to -i and goes to the patch stage

eternal owl
#

I am downloading git kraken

green oriole
#

Okay, nice to know

eternal owl
#

I will get 1 year pro with github student pack \o/

patent pivot
green oriole
#

looking at it hurts my eyes

#

:D

eternal owl
#

its confusing, lol

patent pivot
#

it's pretty nice really

#

it asks you a bit at a time and all you do is y or n

eternal owl
#

oooooh

#

you use gui or cli ?

patent pivot
#

cli

eternal owl
#

on regular basis

#

okay

green oriole
#

CLI

patent pivot
#

my editor is CLI

molten bough
#

Vim or emacs?

patent pivot
#

vim

molten bough
#

Ah okay

#

I liked emacs but it's too slow

patent pivot
#

well, neovim

eternal owl
#

I wonder if atom is still slow while opening these days

#

light theme

patent pivot
#

I choose light theme because it is more comfortable on my eyes and I concentrate better, each to their own.

eternal owl
#

so you use discord light theme as well?

patent pivot
#

yes

#

everything light theme

green oriole
#

Do you still have eyes?

eternal owl
#

I think ur the first person I met who uses light theme haha

woeful thorn
#

I wonder if we'll ever see the day when someone posts a white background without everyone fake screaming about their eyes

patent pivot
#

I share the wonder ELA

molten bough
#

they actually do murder my eyes, to be fair

#

but people should use what they like

patent pivot
#

When I look at a piece of paper I don't scream

crude gyro
#

many of the devs I work with like light themes

#

especially Mac users for some reason

patent pivot
#

I just don't turn up the brightness crazy amounts

molten bough
#

I have factory-calibrated monitors, so I don't touch brightness

green oriole
#

It did really hurt tbh

#

There was no light around me

#

And a sudden white screen

molten bough
#

but I think that might have been a mistake haha

#

I'm no graphic designer

patent pivot
#

turn the lights on then lol

molten bough
#

yeah, don't computer in the dark

#

super bad for your eyes

lapis phoenix
#

i have a monitor at work which has brightness settings disabled, everytime i open up a firefox i gotta look away for a moment

patent pivot
#

using screens in the dark is a great way to hurt yourself, even if dark theme

eternal owl
#

Can anyone tell me why there is profile name as well as name in gitkraken

molten bough
#

username vs real name

green oriole
#

The only light around me is very yellow-ish, it modify the color of the screen, it is quite bad for CG

patent pivot
#

yeah same with github, my username is jos-b but my commits are attributed to Joseph Banks

eternal owl
#

so profile name is the name of my github

patent pivot
#

No wait

molten bough
#

but yeah the light mode dark mode thing is totally a bit of a meme at this point

patent pivot
#

is it like a config thing for storing different configs of gitkraken?

molten bough
#

but some of us do legit have that problem

eternal owl
#

I authorized using github

patent pivot
#

ah for different repos you have different configs

eternal owl
#

okay

molten bough
#

Oh, shit, I totally forgot

#

I had an idea last night

#

I wonder if it would be useful for django-simple-bulma to support generating multiple CSS files with different settings

#

(also not sure how hard that'd be but yknow)

eternal owl
#

what does stage all changes mean

molten bough
#

It means that all changes will be staged

#

Changes are put into the staging area (git add, eg) before you make a commit

eternal owl
#

ooh

green oriole
#

Same as git add .

eternal owl
#

👍

#

The gui is actully good, I can just highlight the lines and stage them, this is so easy, lol

#

So I have a detailview and list view(2 files), does a good commit include both files(as they are quite simple) or should I do 2 commits?

green oriole
#

If one can work without the other, you should do two commits I think

valid quest
brazen charm
#

Not sure if that feature was agreed to

valid quest
#

I used the with_role decorator, but when someone without the Lovefest role invokes the command, he just gets a non informative response -

#

So i wanted to ask if its better to implement the check inside the command and not with a decorator

#

@brazen charm Oh, ok then, i won't pr it until it will be approved

cold moon
brazen charm
#

I think I remember a discussion, but not sure of the result of it. But best to wait for an issue to be approved by the core devs, or asking them before working on it

valid quest
#

Sure, thanks 😄

brazen charm
#

Can we get a reload on the bot doc inventories?

hardy gorge
#

yes

#

!docs refresh

stable mountainBOT
#
Inventories refreshed
+ Python, discordpy, numpy, matplotlib, scipy, django, flask, aiohttp, networkx, kivy, pillow, urllib3, dateutil, pyside2, pandas, more_itertools, requests
brazen charm
#

ty

gusty sonnet
clever wraith
#

it restarted quite a lot

glass pecan
#

backend changes that required a couple of server restarts and process restarts

gusty sonnet
#

@valid quest I don't think making a PR just to change a line which is not causing any critical bug, is worth it

#

Do you also want to refactor pagination.py while you're at it?

#

Then we can sneak in here and there improvements!

valid quest
#

Sure, im currently not home, but yeah sure 😄

#

I thought about a Enum of emoji constant, For future convenience and flexibility

#

Can be inserted into constants.py

green oriole
#

You got rid of the host file section in the site setup guide, didn't you?

hardy gorge
#

No

#

It's still there

#

third point

green oriole
#

Ah, thanks!

gusty sonnet
#

@valid quest The PR is good to be merged, but before that, do you want to move the trashcan to constants.py like with @stable mountain bot? That way we can easily change it later and will make sure that the trashcan used elsewhere will always be the same

molten bough
#

Trashcan for a delete reaction?

gusty sonnet
#

Yes

#

trashcan this one

molten bough
#

huh, it's only been like 3 years since I suggested that

#

haha

gusty sonnet
#

Ah well, I'll leave a request change on the PR, as soon as it's addressed we can merge it

valid quest
#

@gusty sonnet yeah sure, 1 hour until I'm available

#

We'll do some cleanup

#

If you have ideas of improvement, i would love to hear them

#

We also got the issue with the blank page

eternal owl
hardy gorge
#

Yes, it's just a string

eternal owl
#

oh

#

But it will not display the same way on the website

woeful thorn
#

You can render markdown on a website

eternal owl
#

how

#

<code>?

#

how to render

print("this is python")
#

will this require java script?

valid quest
#

@gusty sonnet Hey, im home if you are free to plan

valid quest
#

Hey guys, ive seen that the build is failing, is it because of the latest commits? im trying to figure it out

patent pivot
#

seems to have worked fine

valid quest
#

Is that the seasonal bot? weird

brazen charm
#
./bot/pagination.py:8:1: I201 Missing newline between import groups. 'from bot.constants import Emojis' is identified as Application and 'from discord.ext.commands import Context, Paginator' is identified as Third Party.
./bot/pagination.py:10:1: I202 Additional newline in a group of imports. 'from bot.constants import Emojis' is identified as Application and 'from bot.constants import Emojis' is identified as Application.
./bot/pagination.py:10:1: F811 redefinition of unused 'Emojis' from line 8
#

you should be able to run the linter yourself before commiting

valid quest
#

DELETE_EMOJI = Emojis.trashcan

#

I did

brazen charm
#

or pushing at least

#

Do you have all the flake8 plugins?

#

You can access the log through the github details btw

valid quest
#

oh ok thanks

#

I think i have them yes

#

How can i verify this?

brazen charm
#

pip list I guess

valid quest
#

Oh i installed it, for sure

#

Btw, it looks like its working

brazen charm
#

should have import order, and then the flake8 pointing to the right install

valid quest
#

Yeah, fixed it

#

Sorry for that

#

Shirayuki if you are available, ping me

green oriole
#

Did you also installed the precommit hook?

cold moon
#

Is this too complex or OK:

duration = f"{str(movie['runtime'] // 60) + 'hours' if movie['runtime'] // 60 else ''} " \
                   f"{str(movie['runtime'] % 60) + 'minutes' if movie['runtime'] % 60 else ''}"
brazen charm
#

should use the implicit line continuation at least

cold moon
#

I think I found better way

valid quest
#

@green oriole Can you send me more info so i can see if i did?

green oriole
#

You need to run pipenv run precommit

cold moon
#

How should I fix this:

text += f"**Duration:** {'{} hours(s) {} minute(s)'.format(*divmod(movie['runtime'], 60))}\n\n"

Lint fail:
P101 format string does contain unindexed parameters

green oriole
#

If you want to see if it is installed, look if there is a precommit file in the .git folder

#

You can run it twice thought, that's not an issue

valid quest
#

Ok, what is that tool?

#

Code formatting before the commit?

green oriole
#

It run flake8 before committing and abort it of the linting fails

#

You still have to fix the error manually, but you should be able to use black or something

brazen charm
#

@cold moon I'm guessing you have to pass indices into the braces, but the wording on that is not so great

green oriole
#

@cold moon you don't have indexes ({} instead of like {minutes} ) parameters inside your string

#

^^

cold moon
#

I know. Fixed now:
text += f"**Duration:** {f'{duration[0]} hour(s) {duration[1]} minute(s)'}\n\n"

green oriole
#

I totally blame my wifi for this

#

Nice

cold moon
#

Last test and then push...

#

This list is auto generated

green oriole
#

Nice!

valid quest
#

Cool

valid quest
#

Hey guys, I am currently working on a way to suggest better usage for the command invoker (if the command is misspelt), but the current structure of the error_handler is a bit hard to change for that usage (since it reinvokes every misspelt command as a tag), do you have any ideas (I can implement this idea before the tag reinvoke, but it seems inefficient)

#

I already have the structure for getting all the commands, subcommands, aliases, and search for a matching command, i just need some suggestion for fitting it in the structure of the current error_handler

#

Ping me 👍

#

I can add a quick check to see if the tag exists? if so, that'll be great

#

I guess i can get the cog and read its cache, let me know if you guys have a better implemention or suggestion for this

eternal owl
#

anyone knows how do I display python code on the web?

clever wraith
#

see how they did on contribution tab ?

eternal owl
#

it has to convert

print("hello")```
clever wraith
#

there must be scripts for syntax highlighting

#

rhis can help @eternal owl

#

this*

#

no no no

#

<pre class='python'>

hardy gorge
#

anyone knows how do I display python code on the web?
@eternal owl

There's going to be more markdown than just codeblocks in the description of the tag embeds. Bold text, links, italics, rhey are all used in tags. So, you'll need a more complete solution to render markdown to html/css.

Our wiki uses the Markdown package to do that and that package should offer template tags to apply that rendering in a template. That package is currently not specified as a dependency for our project, so if you're going to use it, you should add it as a direct dependency as well.

eternal owl
hardy gorge
#

Yes

eternal owl
#

okay cool, thanks

hardy gorge
#

And bold, italics, links, underlining,

eternal owl
#

lemme see the wiki page

#

it actully works!

#

I am creating an article and its actully responding to bold, this and and this