Merge branch 'SebastianObi:main' into main

This commit is contained in:
Swissbandit 2023-08-04 03:14:04 +02:00 committed by GitHub
commit 158baaaa16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 53 additions and 376 deletions

View file

@ -5,7 +5,7 @@ For more information, see the configuration options (at the end of the program f
### Features
- Compatible with all LXMF applications (NomadNet, Sideband, ...)
- Compatible with all LXMF applications (Communicator, NomadNet, Sideband, ...)
## Examples of use

View file

@ -84,8 +84,6 @@ PATH = os.path.expanduser("~") + "/." + os.path.splitext(os.path.basename(__file
PATH_RNS = None
#### Global Variables - System (Not changeable) ####
CONFIG = None
RNS_CONNECTION = None
@ -540,7 +538,7 @@ class lxmf_connection:
def sync_now(self, limit=None):
if self.message_router.get_outbound_propagation_node() is not None:
if self.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_IDLE or self.message_router.propagation_transfer_state == LXMF.LXMRouter.PR_COMPLETE:
log("LXMF - Message sync requested from propagation node " + RNS.prettyhexrep(self.message_router.get_outbound_propagation_node()) + " for " + str(self.identity))
log("LXMF - Message sync requested from propagation node " + RNS.prettyhexrep(self.message_router.get_outbound_propagation_node()) + " for " + str(self.identity), LOG_DEBUG)
self.message_router.request_messages_from_propagation_node(self.identity, max_messages = limit)
return True
else:
@ -680,8 +678,6 @@ class lxmf_connection:
log("- App Data: " + message.app_data, LOG_DEBUG)
class lxmf_connection_propagation():
def __init__(self, owner, aspect_filter=None):
self.owner = owner
@ -743,8 +739,6 @@ class lxmf_announce_callback:
log("LXMF - Received an announce from " + RNS.prettyhexrep(destination_hash) + ": " + app_data, LOG_INFO)
#### LXMF - Message ####
def lxmf_message_received_callback(message):
global SESSION
@ -830,8 +824,6 @@ def output(initial=False):
output_now()
def output_now():
global SESSION
global TERMINAL
@ -968,8 +960,6 @@ def config_getoption(config, section, key, default=False, lng_key=""):
return default
#### Config - Set #####
def config_set(key=None, value=""):
global PATH
@ -998,8 +988,6 @@ def config_set(key=None, value=""):
pass
#### Config - Read #####
def config_read(file=None, file_override=None):
global CONFIG
@ -1025,8 +1013,6 @@ def config_read(file=None, file_override=None):
return True
#### Config - Save #####
def config_save(file=None):
global CONFIG
@ -1045,8 +1031,6 @@ def config_save(file=None):
return True
#### Config - Default #####
def config_default(file=None, file_override=None):
global CONFIG
@ -1140,8 +1124,6 @@ LOG_SUFFIX = ""
LOG_FILE = ""
def log(text, level=3, file=None):
if not LOG_LEVEL:
return
@ -1328,8 +1310,6 @@ def setup(path=None, path_rns=None, path_log=None, loglevel=None, service=False)
time.sleep(1)
#### Start ####
def main():
try:
@ -1382,8 +1362,6 @@ DEFAULT_CONFIG = '''# This is the default config file.
# You should probably edit it to suit your needs and use-case.
#### Main program settings ####
[main]
@ -1393,8 +1371,6 @@ enabled = True
name = Terminal
#### LXMF connection settings ####
[lxmf]
@ -1461,8 +1437,6 @@ sync_limit = 8
signature_validated = Yes
#### Terminal settings ####
[terminal]
@ -1477,8 +1451,6 @@ restart_session = True
interval = 5 #Seconds
#### Message settings ####
[message]
@ -1532,8 +1504,6 @@ replace_special_characters = True
replace_unnecessary_characters = True
#### Right settings ####
# Allow only specific source addresses/hashs or any.
[allowed]