Sep 6, 2022 20:42
Have a awesome day and appreciate the help!
Sep 6, 2022 20:42
Thanks for everything!
Sep 6, 2022 20:41
I might do something wrong here and I believe it might be out of the scope of what we are talking about now?
Sep 6, 2022 20:41
Ohhh I see! Thats nice then :D Thanks for the explanation, Im using myself Peewee (ORM) for Postgresql which is as simple as doing "SELECT keyword FROM my_database" and return it as a tuples but...
Sep 6, 2022 20:39
Could you just please just quickly explain for me h ow the "frozenset" works?
Sep 6, 2022 20:38
Oh im using postgresql so I guess I can do however I want? But for sure I could return as a object instead of lists. I can try out abit and see how it ends up :D
Sep 6, 2022 20:37
and thats what you meant with dynamic DB I guess? Sorry if I am asking stupid questions :(
Sep 6, 2022 20:37
Because I cannot read the database once due to it can be some insert/delete bad words so that means I would need to re-read the database everytime I want to match
Sep 6, 2022 20:34
where Database is my class and importing the get_badwords()
Sep 6, 2022 20:34
but I assume inside my get_badword_db, I want to read the DB for all keywords and return as a list? so it would be something like this:
```
def get_badword_db() -> BadWords:
return BadWords.new(Database.get_badwords())
```
Sep 6, 2022 20:34
Oh dear not sure if I can paste everything here
Sep 6, 2022 20:33
That is indeed correct :D so in that case it would be something like
Sep 6, 2022 20:32
but how is the get_badword_db every being used?
Sep 6, 2022 20:30
Hello there and sorry for taking such a time
Sep 6, 2022 20:30
That is correct, do you mean that in your example I should do something like this: hastebin.com/pizeyihisi.py ? I might not quite follow in that case how it really works but I assume I am supposed to read the database list through that function and then call it inside test_badwords_expected?
Sep 6, 2022 20:30
Ahh I see I see! However I have a small issue with def get_badword_db(*args, **kwargs) -> BadWords: im not quite sure what you meant there? How would that work? What should be there e.g. instead of the mock data?
Sep 6, 2022 20:30
Thank you both for the message and as you say @AJNeufeld - This does indeed look alot more complicated compare to yours where you introduce alot of new stuff for me.
 
Nov 18, 2021 14:14
Nov 18, 2021 14:14
@A.B The documentation is abit too hard for me to understand. I dont really know where to start. :'(
Nov 18, 2021 14:14
@Bravo Yes I do. I have also monitored my cpu during past month. The max CPU usage was 25% which I believe it would not be at all any hot. RAM Usage has a free usage of 72GB/93GB. Could it be power psu that dies?
Nov 18, 2021 14:14
@Bravo But that would have been log the SINGAL error in that case if its a CPU temps, no?
Nov 18, 2021 14:14
@Bravo that ip address is my local ip address that I connect to the server. so my computer crashed when it happen so I dont believe thats the cause of it barrythrill pts/0 60.10.100.900 Mon Nov 15 10:01 - crash (03:33)
Nov 18, 2021 14:14
@Bravo I have also added last
Nov 18, 2021 14:14
I have been checking all logs and I could not find anything between the timestamp that caused the error... @Bravo - Is there anything else I could look at?
Nov 18, 2021 14:14
@Bravo I have also added additional info from less /var/log/syslog you can see that something happen between Nov 15 13:25:48 -> Nov 15 13:34:28
Nov 18, 2021 14:14
@Bravo So far its been every other day since 13 nov. Meaning 13th, 15th and 17th
Nov 18, 2021 14:14
@Bravo I did nano lastlog -> ^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@^@^@‌​^@^@^@^@^@^@^@^@>
Nov 18, 2021 14:14
@Bravo So far I have looked into /var/log/syslog, /proc/sys/kernel/panic, /var/log/kern.log
Nov 18, 2021 14:14
Hello @Bravo - I cannot seem to find which other logs I could look at. Do you have any tips where more to look for logs as I am not able to find any.
 
Apr 30, 2021 14:55
Hello :)
Apr 29, 2021 23:51
--------------------------------------------------
I need to go to bed now!

so if I understood it correct, You want me to use the

product = Product.from_page(url=link)

product.sizes
product.name

instead of calling the dict and use for example payload["sizes"] as we do have a beautiful class for it.

However the issue I do have is that the values I have in my `def payload(self) -> dict:`will not be the same as I return with
```return cls(
link=link,
name=name,```
as im not able to do self.name which I can set a default as None for example but when returning inside a cls that is not possi
Apr 29, 2021 20:50
but if I go back to the reason, wouldnt it work if I just do:

product = Product.from_page(url=link)

product.sizes
product.name
product.payload # This will give me the dict
Apr 29, 2021 20:50
^ Please ignore this part :P
Apr 29, 2021 20:42
but I dont know why it says "Unresolved attribute reference 'name' for class 'dict' " when im calling

payload = Product.from_page(url=link)
print(payload.name)
Apr 29, 2021 20:27
Ohhhh it was like that whataheck, I could actually do


payload = Product.from_page(url=link)
print(payload.name)
print(payload.sizes)

etc etc
Apr 29, 2021 20:19
Is that what you want me to do or am I thinking wrong?
Apr 29, 2021 20:15
payload.sizes ?
Apr 29, 2021 20:14
payload = Product.from_page(url=link)
Apr 29, 2021 20:14
Shouldnt I be able to then just do:
Apr 29, 2021 20:12
return cls(
name=name and name.text.strip(),
price=price and price.text.strip(),
image=image and image['content'],
sizes=cls.get_sizes(doc),
)
Apr 29, 2021 20:10
which returns the cls(...)
Apr 29, 2021 20:10
"make a @classmethod constructor that accepts a dictionary and returns a class instance" I do already have a classmethod in ProductPage
Apr 29, 2021 20:09
But now im probably overthinking again.
Apr 29, 2021 20:09
and then pass it to discord if the comparision function returns True
Apr 29, 2021 20:09
which I basically just pass around the payload from the dataclass around but I kinda get what you mean but that means we basically just scrape it once
Apr 29, 2021 20:08
payload = Product.from_page(url=link).payload
Apr 29, 2021 20:08
Because right now as you can see I do
Apr 29, 2021 20:08
but if I call it at the very end like discord. Dont it need to scrape all the values all over again? Or am I missing something here
Apr 29, 2021 20:05
Or do I just remove and forget about the payload?
Apr 29, 2021 20:05
so etc where I have the @property payload I should instead use @classmethod?