flake8 refactors get onlinePeers

This commit is contained in:
Kevin Froman 2019-12-18 04:08:33 -06:00
parent 9707d5e320
commit f7e2a94502
1 changed files with 13 additions and 10 deletions

View File

@ -1,9 +1,12 @@
''' """
Onionr - Private P2P Communication Onionr - Private P2P Communication
get online peers in a communicator instance get online peers in a communicator instance
''' """
''' import time
from etc import humanreadabletime
import logger
"""
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or the Free Software Foundation, either version 3 of the License, or
@ -16,14 +19,14 @@
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. along with this program. If not, see <https://www.gnu.org/licenses/>.
''' """
import time
from etc import humanreadabletime
import logger
def get_online_peers(comm_inst): def get_online_peers(comm_inst):
''' """
Manages the comm_inst.onlinePeers attribute list, connects to more peers if we have none connected Manages the comm_inst.onlinePeers attribute list,
''' ]connects to more peers if we have none connected
"""
config = comm_inst.config config = comm_inst.config
logger.debug('Refreshing peer pool...') logger.debug('Refreshing peer pool...')
maxPeers = int(config.get('peers.max_connect', 10)) maxPeers = int(config.get('peers.max_connect', 10))