several minor fixes
This commit is contained in:
parent
d2f9bbb94c
commit
1fce063052
1 changed files with 31 additions and 25 deletions
|
|
@ -37,7 +37,7 @@ __all__ = ['PriorityConnection']
|
|||
class PriorityConnection(Optimization):
|
||||
CONFIG = ValuesDict(ValueInt('minimal', label='Minimal of godchilds', default=5),
|
||||
Value('domain', label='Domain to use for fake accounts emails', default='aum.example.com'),
|
||||
Value('interval', label='Interval of checks (seconds)', default=3600)
|
||||
ValueInt('interval', label='Interval of checks (seconds)', default=3600)
|
||||
)
|
||||
|
||||
def __init__(self, sched, storage, browser):
|
||||
|
|
@ -110,7 +110,7 @@ class PriorityConnection(Optimization):
|
|||
# We'll check later
|
||||
return
|
||||
|
||||
missing_godchilds = self.config['minimal'] - nb_godchilds
|
||||
missing_godchilds = int(self.config['minimal']) - nb_godchilds
|
||||
if missing_godchilds <= 0:
|
||||
return
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ class PriorityConnection(Optimization):
|
|||
sex= 1, #slut
|
||||
birthday_d= random.randint(1,28),
|
||||
birthday_m= random.randint(1,12),
|
||||
birthday_y= random.randint(1970, 1990),
|
||||
birthday_y= random.randint(1975, 1990),
|
||||
zipcode= 75001,
|
||||
country= 'fr',
|
||||
godfather= my_id)
|
||||
|
|
@ -153,7 +153,10 @@ class PriorityConnection(Optimization):
|
|||
self.logger.info('Fake account "%s" created (godfather=%s)' % (name, my_id))
|
||||
|
||||
def activity_fakes(self):
|
||||
try:
|
||||
fakes = self.storage.get('priority_connection', 'fakes', default={})
|
||||
if len(fakes) == 0:
|
||||
return
|
||||
while 1:
|
||||
name = random.choice(fakes.keys())
|
||||
fake = fakes[name]
|
||||
|
|
@ -175,3 +178,6 @@ class PriorityConnection(Optimization):
|
|||
# deblock
|
||||
browser.deblock(profile.get_id())
|
||||
return
|
||||
except BrowserUnavailable:
|
||||
# don't care
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue