formatting and comment improvements, cleanup
This commit is contained in:
parent
714b3a3c33
commit
782c980b69
13 changed files with 207 additions and 124 deletions
|
@ -1,3 +1,7 @@
|
|||
"""Onionr - Private P2P Communication.
|
||||
|
||||
Get an auto updating list of blocks
|
||||
"""
|
||||
from threading import Thread
|
||||
|
||||
from watchdog.observers import Observer
|
||||
|
@ -7,6 +11,20 @@ from utils.identifyhome import identify_home
|
|||
from coredb.dbfiles import block_meta_db
|
||||
from coredb.blockmetadb import get_block_list, get_blocks_by_type
|
||||
from onionrutils.epoch import get_epoch
|
||||
"""
|
||||
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
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
"""
|
||||
|
||||
class BlockList:
|
||||
def __init__(self, auto_refresh=True, block_type=''):
|
||||
|
|
|
@ -40,7 +40,9 @@ from onionrtypes import UserIDSecretKey
|
|||
|
||||
|
||||
def _check_upload_queue():
|
||||
"""Returns the current upload queue len
|
||||
"""
|
||||
Return the current upload queue len.
|
||||
|
||||
raises OverflowError if max, false if api not running
|
||||
"""
|
||||
max_upload_queue: int = 5000
|
||||
|
@ -63,11 +65,11 @@ def insert_block(data: Union[str, bytes], header: str = 'txt',
|
|||
expire: Union[int, None] = None, disableForward: bool = False,
|
||||
signing_key: UserIDSecretKey = '') -> Union[str, bool]:
|
||||
"""
|
||||
Create and insert a block into the network.
|
||||
Create and insert a block into the network.
|
||||
|
||||
encryptType must be specified to encrypt a block
|
||||
if expire is less than date, assumes seconds into future.
|
||||
if not assume exact epoch
|
||||
encryptType must be specified to encrypt a block
|
||||
if expire is less than date, assumes seconds into future.
|
||||
if not assume exact epoch
|
||||
"""
|
||||
our_private_key = crypto.priv_key
|
||||
our_pub_key = crypto.pub_key
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue