#dev-contrib
1 messages · Page 45 of 1
when that is a child element
So i need to have another div below that
so <element class="notification is-info"> is a child of <element class="messages">
i cant use div?
element can be whatever
okay
works now, need to get everything in the correct place now, haha
done
any more changes needed to the detail page?
what do you guys think
I think I should make the image a lil bigger
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
oh yea the arrow marks
Also, does the general ListView have a default ordering? We could specify that in the model meta options.
there is no ordering set in the model
Okay, we probably do want that, since it would make locating a tag much easier
yea, alphabetically could do
Do we want me to add that ordering while I am working on this?
Well, we want those tags to be ordered right?
yep
So it would be easier, right?
yea
They should be printed to the terminal output
do print statements work in class based views?
I don't know, probably not
ohk
You could always add some logging lines instead of a print
Or use a real debugger :P
@green oriole wonder you can review my PR ?
@eternal owl you too
#349 seasonalbot
This time i will use debugger
I don't think our reviews really count now
to use vscode debugger, should I run the project through vs code?
or should i get pycharm 
I don't really know, I haven't really played with the debugger yet
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
wow thats cool
I will look into that, thanks!
btw Im gonna run migrations for the model ordering
nvm it does it automatically
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
okay
So we only have one migration file on the repo
okay
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
Or just rename the migration file
But in most cases, the default message is good enough
I docker did it for me
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
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)
okay
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
well, yes, but it's not 0003_auto....
which is typically what you get if you let Django name the migration file itself
I meant it is okay to left it if the default name is comprehensive enough, not those default auto migration thingys
bot/seasons/evergreen/bookmark.py:74:21: E126 continuation line over-indented for hanging indent
what does this mean ?
@clever wraith https://www.flake8rules.com/rules/E126.html
A continuation line is indented farther than it should be for a hanging indent.
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
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"
@gusty sonnet I am unsure what you meant of the last comment
Do you know about set in python?
Why is that?
list is easy to maintain
they have separate uses
They are both easy to maintain imo, and set is a very very strong hashtable-like collection
and most of its thing is straight forward
Specially in this case you only keep a collection to do membership checking
Then set is superior to a list in every single way
in readibility also ?
So do its readability and maintainability
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
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)
))
@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
You can see that the set is about 800 times faster
I wasted almost 30min searching for the thing haha, thanks @molten bough
did you just typed that code RN ?
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
ahh nice , i am not saying that in that case
i am asking to minimize commits
so that i don't left anything beside
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.
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
You either do py sent_person = set() sent_person.add(ctx.author)or you dopy sent_person = {ctx.author}
same as with a list
When you do set(ctx.author) it will try to convert ctx.author to a set
Similar to calling list(ctx.author)
ahhh ok
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}
It was, but the performance is about 800 times faster
so while in check i have to convert it into list right
You do not have to convert anything to a list
and user not in list(sent_person)```
A simple user not in sent_person is fine
I miss understood the previous error
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
it's just super().save(*args, **kwargs) I think
you have a python 2 style super call
ops
does not work still
maybe it should be self.title = self.title.capitalize()
edit: works now!
You should also change the comment to match the type @clever wraith
Right now it's # list of id who got the message
I'd assume it gets the values from the instance, definetly won't see your random title var
are we gonna reach 100 comments this time ?
https://streamable.com/7aq2k
check it out
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
oh man its gonna be laggy experience for users like me
the website?
yeaa....I have 0 knowledge of js to use ajax 😓
I think someone can help me out with that
i have that in negative
If anyone knows js and can help me render a page without refreshing, do ping me @
When will my SeasonalBot PR be reviewed?
Ah, which one are you doing @cold moon can you link it again
It probably wont be overkill if we have lot of tags
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 >.>
https://streamable.com/7aq2k here it is @green oriole
@gusty sonnet https://github.com/python-discord/seasonalbot/pull/350
Nah, using Ajax isn’t needed, even if you want to read all the tags, you aren’t going to spam the next button
Gotcha! I will open it and do a test run tomorrow
okay
can't for merging of mine
NOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
?
I forgot to add a . in one of the message
Which message?
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
Have you pushed yet?
You can amend it to the latest commit
how ?
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?
i need to learn git , but yeah commited it
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
Yes
will get it for my kindle
@green oriole For me this works, just this throw error when trying to use command
Time to sleep now,
Here is what I have done so far:
https://streamable.com/cemby
Do leave some feedback, I will check it in the morning
Okay great ks
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?
whatever get_object_or_404 returns - probably a Union[Tag, Reponse] but double-check
You also have Optional and some funny stuffs like that
in what context
You also have genric types like Sequence, Mapping, Callable.. https://docs.python.org/3/library/typing.html#generics
How the production environment is deployed?
yea
For the most part yeah iirc
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
Repo: Github -> CI: Azure Devops -> Docker Hub -> VPS: Saltstack Webhook -> Docker Pull and Deploy
Scragly knows far more about the process than I do, though, so he's probably writing a killer message
It's not super complex, but there are a few moving parts
Which one should I start learning
github
What else is there in github to learn other than daily stuff
okay
oh
if you just generally want to learn, CI is next after github yeah.
Configuring GitHub, protected branches, getting experience with the entire routine of pull requests -> reviews -> merging
Then maybe a simple CI with checks for GH
okay
Which could just be GitHub actions with flake8
Github Actions specifically is what i'd be suggesting, yeah
GH actions feels a touch lacking imo, but it's quite capable
it's pretty good
It's probably what we'd use if it was available when we started
I recently started with Actions, it is pretty straitforward to use, but the docs are kind of meh
the rest can be coded
It isn’t to late to switch
Sure, but it's work
there's no need to switch
I have a project that actually can only be built on azure haha
what we have works fine now
since it needs the extra RAM
Yes true
there's no real need to change a stack unless there's a feature missing or it costs us unnecessarily
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
azure doesn't cost us and it doesn't have any missing features
But I feel like the extra integrations with github is worth switching
It does integrate
azure has it's own featureset
I have github student pack, I think it gives me lot of free stuff
Actions is already free
Yeah, you can have github pro free and the jetbrain suite free too
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)
But you can click on discord webhook message with Actions
You mean triggering a release pipeline?
Yes, that's true. We do use GH actions for things like flake9-annotations
flake8, but you get the idea
flake9 lol
I have another question regarding rest API( As I almost finished the tutorial on the official website)
better, faster
Flake VIII-2
now, with more flakes
Azure does have release pipelines, though
So we use rest API to access/modify a database? or is there anything else to it?
Oh, triggering a pipeline when a release is published to GH?
if you create a github release tag, azure won't trigger
Right, right
You can use whatever you want with the rest framework
there's external things you could do to make it do so, but actions has that built in
And then you take the tag and release it to PyPi
Not a bad idea
we use it for annotations
i created a similar thing for a few other projects too, non-pydis
We use it to trigger db queries, but you can do whatever you want
@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.
sounds a bit broad of a thing to give a specific example for lol
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
@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?
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
precisely
why bother doubling up
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
probs for the best
Having only one database in the site is easier than two, one for the site, one for the bot
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.
Yep, that was the ol' frankenflask site
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
even if you could, you'd have to figure out how to synchronise migrations
oooh so the db wasn't designed using sql but through django orm, i get it now
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
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
like i said, we can do that anytime with sqlite
okay cool
just look at seasonalbot, it does this already
To be fair, having the django admin to manage everything as well is handy too
django admin is nice, yeah
The downside is that we wouldn't have a web app front-end
There is an sqlite db on seasonal?
esp with oauth permissions now working
there's a number of persistant data files on seasonalbot
Who's in charge of the API at the moment, by the way?
any persistant datafiles are attainable with
https://github.com/python-discord/seasonalbot/blob/master/bot/utils/persist.py
I remember Volcyy was in charge of it but I haven't seen him in forever
core devs, collectively, gdude
we might need sqlite db for @dusky shore
nothing is changed on a whim
Yes, I know that, I just didn’t know that they were a sqlite db
@eternal owl look at the link i sent above
datafile is something like json file?
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
The place where the file is stored I think
oh
There is no docstring?
what do you mean
Copy datafile at the provided file_path to the persistent data directory.
Hmm
okay
A directory that resist to salt redeployment
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
Is it a linode block storage?
no
This can help for the quiz game also
you wouldn't really use block storage unless you were using something like kubernetes or a CDN
scores
So you can’t like, detach the block and reattach it to another instance if the main instance fails?
.quiz leaderboard
not sure if a quiz leaderboard is really needed, but it's on the right track for suitable uses
okay
really it would be better if the quizes had more content and variety added instead
yeaa..we have only 30q so far
since that takes more effort and time, it's pretty important to chip away at it over a longer period of time
Ves mentioned a feature where we can add new questions using a command
It would he cool to alsp have various topics
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
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
it's kind of a shame that the site connection has a long setup process
If you ask me, finding a good quiz api which can get us 1000s of questions without us breaking a sweat
if it was easier or automatic then maybe it wouldn't be too awful to have seasonalbot use it
Well it'd be the easiest way to manage the quiz questions
i don't see how it's easier than just using an sqlite or json file though
The only difficulty I can see is the complication of local set-ups
unless the bot had an exposed api instead, and the site connected to it
I'm thinking from a UX perspective
which user are you talking about
since members who use the command won't even notice the difference
Whoever is managing the questions
I think you're adding layers of complexity to this that don't really need to be there for this kind of project
hmm, dunno. a collection of json files are pretty simple to go through in reviews.
And just as easy to update
Yeah, true I guess
Should I open an issue for discussion on how we are gonna add questions and of which type?
But nobody really suggest questions so..
I mean, a lot of seasonalbot features are fire-and-forget, yeah
That's a big point of it
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
Yup
tbh activity of seasonalbot contributors has come down
Simple projects and fun for new users to learn how to do cool stuff and contribute to their community
yea
we just went through Christmas, New Years, January holidays and starting of school
Plus the beginning of the year is a pretty busy time
ofc it's lower at this time of the year lol
School's the major contributing factor I think
this is a common cycle at any rate
We have a significant number of school age users
yeah
2nd in contribs, xD
plus if they aren't, they are often parents
Im in high school @mellow hare
I'd say the activity levels are fine and there are quite a few major projects planned for 2020
Yep
There's plenty to do for the group of people we have
I mean, there are always some core devs ready to contribute, that’s why you have some major projects planned
my major project is || REDACTED ||
always ready to contribute
Tax season
Sure.
I'm barely ready to live
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
Plus most of the core devs doesn’t sleep, it helps a lot 😄
haha
True
how manys hours of sleep do you get scragly
not enough
usually 10 hrs a day
That's your average
I dont think so 
I've seen it vary from 2 to 16
yes it's my avg
wow 😂
i always catch up if i go without a while
Well, 2h one day, 16h the following day 😄
pretty much
hems not joking when he said 16
also the times when i sleep are all over the place
I try to get 8, it usually becomes 7, sometimes 6.
how is it possible?16 hours? do you take sleep breaks?
that's kinda the main reason why it feels like i might be "always" around
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
Is it like, 10h in a row or just 10h in the day?
10h in a row usually, by avg
I've slept for 16 hours before
once im asleep, i won't wake back up until i'm good again
Where's my bucket
unless someone pings you
lol
i dont understand how pings wake you up
that's true, i've been pingarood and i was light enough sleeping i had a look into it
(It's a joke)
you mean, you don't put your phone next to a megaphone at night?
lol no need when its on full volume because i need my 12 alarms to get me up for a job
haha
hahaha that exists
jeez
I know some people that can be woke up just by the vibration of the phone
ela has that on hand because he owns it
So yeah
he?
He just took a picture haha
I am, surprisingly, not taylor swift
WHAT
haha
how unfortunate
How old is that taylor swift gif
And here I thought I was supporting you by buying so many of your albums
lol
"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
any plans of returning to the staff role @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
Meh, Taylor swift isn't even a python dev, I'm disappointed
u had owner role before?
but no, not really
I think I am ready to make a PR for the tags issue (site repo)
\o/
\o/
I didn't
see it
and that link doesn't work for me
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:
that was an interesting code block
You can make use of tags using <code>!tag <tagname></code> on Discord. The following tags are available:
I'd say something like that
okay
How often do you guys have staff meeting
once a week
Okay
why
Nothing, just wanted to know
I fixed now my PR (.movies command, moved genres to if-elif-else statement from subcommands)
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
@cold moon you shouldn't use that amount of if/elif, you should generate the argument dynamically
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 )
Oh, OK, I'll fix
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)```
@gusty sonnet :white_check_mark: Your eval job has completed with return code 0.
001 | Action 28
002 | Adventure 12
003 | Animation 16
It is nicer than a dictionary in this case I believe
Okay
For the second part of the command you can simply use genre.title()
Can I use docstrings between the functions as well or just single line comments?
Okay
Done!
# ----------------------------------------
"""
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
Are these lines added by pycharm? # ----------------------------------------
no I added those
Do you intend to keep them in the code that gets merged?
Looks clean, distinguished
It doesn't
When it comes to stuff like that, stick with the style of the rest of the repo
okay
For the comment itself, it's fine but it seems overly verbose
I will try to shorten it
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?
that error message seems a bit verbose
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?
maybe the API key's expired or something?
or you've misconfigured your API key
TMDB_API_KEY = environ.get('TMDB_API_KEY'
@glass pecan may i ask why you suggested using contexlib to suppress a exception rather passing it ?
Should I move get_random_movies to multiple functions inside of Movie cog, and use them inside command?
Can anyone re-review my PR?
merge ?
@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.
so i think its done. can we merge it ?
And also may now my PR get merged?
Have some patience please.
ok
@tawdry vapor Thanks 😄
You're welcome.
Now i will be able to contrib also, cool 🙃
Whoop, ive setup my webhooks and channel ids properly, is that should be a problem?
@valid quest No
Hmm well then
If you build the bot with the website it will fix it
It could be indicative of the connection to the site being misconfigured.
Already did @hollow lichen
Do you see an exception in the logs?
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
Ah ok, then there’s a problem somewhere 😉
Feb 15 21:21:32 Bot: | bot.api | WARNING | Cannot send logging record to the site, got code 401.
Are you using Docker for both?
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
Those are all related. The API token is incorrect so they're probably all 401s i.e. failure to authenticate
Yeah, i will check that
I believed the token did not require your attention when you're using Docker for both
Which token is it?
Hold on
Yeah, well, the dumbest man award goes to @valid quest
But it says there it is given automatically
Yeah it should be
So leave it blank?
Just don't include it at all.
You're using docker-compose up to start both right?
As in, one command starts both services
Yeah
Maybe something is broken then. The key should be automatically given
It's in the compose file for sure https://github.com/python-discord/bot/blob/master/docker-compose.yml#L44
The site may not be creating the user properly.
Could be
Seems like it. I'm looking at it right now and the logic doesn't really make sense
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
@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?
Sorry for my dumb moment
So how did you fix the token issue?
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
@tawdry vapor whats the context?
Just when using it to run the server, specifically in debug mode via compose
just normally?
Yeah
I don't get why the logs just disappear towards the end.
The web server still goes up of course
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
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
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
Good morning 🙂
lol, g'morning
I'll make an issue actually
probs a smart idea
Just for record keeping and not forgetting
@tawdry vapor can you test something for me
sorry to interrupt, you guys have any suggested open issues to work on? I have experience with discord.py and asyncio
if it's your first time contributing with us, i'd suggest looking at open issues on SeasonalBot
Sure, thanks
What do you need? @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?
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
if you unassiged, did you comment on it to say so?
Yes
coolio, just had to check as we don't get notifications via email otherwise
What line?
Yeah, it does.
nice
Oh, there’s an actual reason why print statements don’t appear? I thought I was just losing my mind
We all were 😄
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
Does that just affect the site?
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
Ah, ok
👀 well that is interesting
but i don't think i've noticed much when running bots through it the same way
I was seeing it with bot earlier but it was intermittent
then i guess we should add it by default for dev composes
that would have been a fair thought lol
🤔 I did notice some warnings not appearing but I don't know if that was related
Like warnings warnings, not log warnings
Never mind, I don't run bot with Docker so that couldn't be the cause
i never remember which one warnings use though
i hate warnings as i'm not a lib dev lol
It's something else. Some warnings appear, others don't
I just used logging in the end
Should SeasonalBot have Wikipedia search?
not actually neede
It's been discussed before; I'm not sure what the conclusion was.
Is there an issue for it?
iirc there was a PR / someone who wants to do it
Ah yes, there is an issue - https://github.com/python-discord/seasonalbot/issues/331
It was originally a suggestion for @stable mountain
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
enumerate
except
exit()
If you forget the space
!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!*
Haha, that's a great one
hey there guys, I need to create a branch for my issue pr?
Yep
Thanks, it just seems there are no Branches, so i tought its wrong to open one
I want help with Bot and Site too, but my biggest problem is setting everything up...
You have to create a branch from master and then PR to master
Yeah, ive read that, just
Thanks, it just seems there are no Branches, so i tought its wrong to open one
Confused me
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...
setting up docker on windows was a pain for me, so it’d probably be even worse on mac
Oh :(
It's easiest in linux
Not good for me
I don't think docker on mac is a nightmare
It's particularly Windows Home that's a pain
it's not great on mac
it runs alright but it is a gigantic memory hog
hyperkit memory leaks like a bucket with no bottom
@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
Oh yeah. sure
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?
The cloud in that logo is very low res compared to the rest of that logo
It's something we use to share files internally
Oh, nextcloud instance I guess
yes
I have yet to use it
It's kind of like having your very own dropbox
complete with calendars, notes, all that fun stuff
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
@green oriole Sure, just saw this style in another branches, my bad
I also do that for issue numbers actually
although I don't use git cli so I guess I never thought of it
git fetch upstream
git pull upstream/master
will these 2 commands update my branch?
I just need to update my gitignore file to include .vscode
I din't know I could do that 😅
Quick question: what is requirements to get Contributor role?
Get a PR merged
OK... I got one approve for my PR. Waiting second
Sometimes more than one
Just be patient
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
any git guis you guys can recommend for linux?
pycharm has a nice one
VS code also has one
I think you use at least one of those already
haha
gitkraken is nice for standalone if you don't want to go down the integrated route and are satisfied with your editor
I am using vs code
also to be honest git log is nice
gitkraken is nice, but I've had it break too many repos to recommend it
can I use git add -i in vs code gui?
also I think they still require you to make an account
git add -i? add has an interactive mode?
yes
yeah
I don't see why you'd need something like that in something like an IDE though
I made a mistake of not commiting on the go so I will commit small chunks fo code(leading to many commits)
surely you'd just mark the files you want to add to the commit from the file tree
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
I dunno, I don't use git CLI
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
It is -i for small part of code
okay
@green oriole no it is -p as well
-p just skips the introduction to -i and goes to the patch stage
I am downloading git kraken
Okay, nice to know
I will get 1 year pro with github student pack \o/
its confusing, lol
cli
CLI
my editor is CLI
Vim or emacs?
vim
I choose light theme because it is more comfortable on my eyes and I concentrate better, each to their own.
so you use discord light theme as well?
Do you still have eyes?
I think ur the first person I met who uses light theme haha
I wonder if we'll ever see the day when someone posts a white background without everyone fake screaming about their eyes
I share the wonder ELA
When I look at a piece of paper I don't scream
I have factory-calibrated monitors, so I don't touch brightness
turn the lights on then lol
i have a monitor at work which has brightness settings disabled, everytime i open up a firefox i gotta look away for a moment
using screens in the dark is a great way to hurt yourself, even if dark theme
Can anyone tell me why there is profile name as well as name in gitkraken
username vs real name
The only light around me is very yellow-ish, it modify the color of the screen, it is quite bad for CG
yeah same with github, my username is jos-b but my commits are attributed to Joseph Banks
so profile name is the name of my github
No wait
but yeah the light mode dark mode thing is totally a bit of a meme at this point
is it like a config thing for storing different configs of gitkraken?
but some of us do legit have that problem
I authorized using github
ah for different repos you have different configs
Create multiple profiles in GitKraken to quickly switch between repository preferences. Manage different gitconfig settings, repositories, and more!
okay
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)
what does stage all changes mean
It means that all changes will be staged
Changes are put into the staging area (git add, eg) before you make a commit
ooh
Same as git add .
👍
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?
If one can work without the other, you should do two commits I think
Hey there, ive implemented a check for the bemyvaletine command, as suggested in https://github.com/python-discord/seasonalbot/issues/344
Not sure if that feature was agreed to
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
What you guys think about https://github.com/python-discord/seasonalbot/issues/354 ? Should this get approved
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
Sure, thanks 😄
Can we get a reload on the bot doc inventories?
+ Python, discordpy, numpy, matplotlib, scipy, django, flask, aiohttp, networkx, kivy, pillow, urllib3, dateutil, pyside2, pandas, more_itertools, requests
ty
Ego boosted successfully!
backend changes that required a couple of server restarts and process restarts
@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!
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
You got rid of the host file section in the site setup guide, didn't you?
Ah, thanks!
@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
Trashcan for a delete reaction?
Ah well, I'll leave a request change on the PR, as soon as it's addressed we can merge it
@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
Yes, it's just a string
You can render markdown on a website
how
<code>?
how to render
print("this is python")
will this require java script?
@gusty sonnet Hey, im home if you are free to plan
Hey guys, ive seen that the build is failing, is it because of the latest commits? im trying to figure it out
Is that the seasonal bot? weird
@patent pivot Can you take a look at this one? https://dev.azure.com/python-discord/web/build.aspx?pcguid=a4900c06-bea4-4b1b-930f-7bd7a2e05a22&builduri=vstfs%3A%2F%2F%2FBuild%2FBuild%2F5971
./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
or pushing at least
Do you have all the flake8 plugins?
You can access the log through the github details btw
pip list I guess
should have import order, and then the flake8 pointing to the right install
Did you also installed the precommit hook?
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 ''}"
should use the implicit line continuation at least
I think I found better way
@green oriole Can you send me more info so i can see if i did?
You need to run pipenv run precommit
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
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
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
@cold moon I'm guessing you have to pass indices into the braces, but the wording on that is not so great
@cold moon you don't have indexes ({} instead of like {minutes} ) parameters inside your string
^^
I know. Fixed now:
text += f"**Duration:** {f'{duration[0]} hour(s) {duration[1]} minute(s)'}\n\n"
Nice!
Cool
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
anyone knows how do I display python code on the web?
see how they did on contribution tab ?
it has to convert
print("hello")```
there must be scripts for syntax highlighting
rhis can help @eternal owl
this*
no no no
<pre class='python'>
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.
so it will help me render this
https://cdn.discordapp.com/attachments/635950537262759947/678967608602787859/unknown.png?
Yes
okay cool, thanks
And bold, italics, links, underlining,
this one