mirror of
https://github.com/markqvist/LXMF-Tools.git
synced 2025-07-23 23:20:33 -04:00
Merge branch 'SebastianObi:main' into main
This commit is contained in:
commit
158baaaa16
22 changed files with 53 additions and 376 deletions
|
@ -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
|
||||
|
|
|
@ -75,8 +75,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
|
||||
|
@ -439,7 +437,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:
|
||||
|
@ -579,8 +577,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
|
||||
|
@ -642,8 +638,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):
|
||||
if CONFIG["lxmf"].getboolean("signature_validated") and not message.signature_validated:
|
||||
|
@ -805,8 +799,6 @@ def config_getoption(config, section, key, default=False, lng_key=""):
|
|||
return default
|
||||
|
||||
|
||||
|
||||
|
||||
#### Config - Set #####
|
||||
def config_set(key=None, value=""):
|
||||
global PATH
|
||||
|
@ -835,8 +827,6 @@ def config_set(key=None, value=""):
|
|||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
#### Config - Read #####
|
||||
def config_read(file=None, file_override=None):
|
||||
global CONFIG
|
||||
|
@ -862,8 +852,6 @@ def config_read(file=None, file_override=None):
|
|||
return True
|
||||
|
||||
|
||||
|
||||
|
||||
#### Config - Save #####
|
||||
def config_save(file=None):
|
||||
global CONFIG
|
||||
|
@ -882,8 +870,6 @@ def config_save(file=None):
|
|||
return True
|
||||
|
||||
|
||||
|
||||
|
||||
#### Config - Default #####
|
||||
def config_default(file=None, file_override=None):
|
||||
global CONFIG
|
||||
|
@ -977,8 +963,6 @@ LOG_SUFFIX = ""
|
|||
LOG_FILE = ""
|
||||
|
||||
|
||||
|
||||
|
||||
def log(text, level=3, file=None):
|
||||
if not LOG_LEVEL:
|
||||
return
|
||||
|
@ -1160,8 +1144,6 @@ def setup(path=None, path_rns=None, path_log=None, loglevel=None, service=False)
|
|||
time.sleep(1)
|
||||
|
||||
|
||||
|
||||
|
||||
#### Start ####
|
||||
def main():
|
||||
try:
|
||||
|
@ -1214,8 +1196,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]
|
||||
|
||||
|
@ -1225,8 +1205,6 @@ enabled = True
|
|||
name = Echo Test
|
||||
|
||||
|
||||
|
||||
|
||||
#### LXMF connection settings ####
|
||||
[lxmf]
|
||||
|
||||
|
@ -1293,8 +1271,6 @@ sync_limit = 8
|
|||
signature_validated = Yes
|
||||
|
||||
|
||||
|
||||
|
||||
#### Message settings ####
|
||||
[message]
|
||||
|
||||
|
@ -1346,8 +1322,6 @@ fields = Yes
|
|||
fields_remove =
|
||||
|
||||
|
||||
|
||||
|
||||
#### Right settings ####
|
||||
# Allow only specific source addresses/hashs or any.
|
||||
[allowed]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue