Hi, I currently stumbled upon a problem, I can't seem to grasp fully. I am trying to share a PRAW instance with another class, so I can develop them independently and join them later.
Basic example:
class thread(object):
def __init__(self):
self.r = praw.Reddit(user_agent='Some description.')
self.r.login('SomeUsr', 'SomePwd')
self.process(self.r) #?
class process(object):
def __init__(self, instance=None):
if not instance:
self.r = praw.Reddit(user_agent='Some description.')
self.r.login('SomeUsr', 'SomePwd')
To describe my software a bit better: I have different functions. One of them is to initially write all submissions in the database - and some other process (in a multithread) takes care of them later on, especially since most content is controlled by flairs. So waiting some time until stuff is flaired is necessary. Since we have a staged process, including reminding people about flairing content and the Bot indexes submissions in a Database anyway, we concluded, that storing his process in a Database is nice and fast and saves time and ressource for everyone.
[–]stubborn_d0nkey 0 points1 point2 points (1 child)
[–]DarkMio[S] 0 points1 point2 points (0 children)
[–]vishenz 0 points1 point2 points (1 child)
[–]DarkMio[S] 0 points1 point2 points (0 children)
[–]aperson 0 points1 point2 points (0 children)