2019-10-22 16:24:37 +02:00
|
|
|
"""
|
|
|
|
Global runtime variables.
|
|
|
|
"""
|
2017-01-12 06:58:35 +01:00
|
|
|
|
2017-01-11 14:27:19 +01:00
|
|
|
neededPubkeys = {}
|
2017-02-06 17:47:05 +01:00
|
|
|
streamsInWhichIAmParticipating = []
|
2017-01-11 14:27:19 +01:00
|
|
|
|
|
|
|
extPort = None
|
2019-10-22 16:24:37 +02:00
|
|
|
"""For UPnP"""
|
2017-01-11 14:27:19 +01:00
|
|
|
|
|
|
|
socksIP = None
|
2019-10-22 16:24:37 +02:00
|
|
|
"""for Tor hidden service"""
|
2017-01-11 17:00:00 +01:00
|
|
|
|
2024-04-17 15:55:10 +02:00
|
|
|
appdata = ""
|
2019-10-22 16:24:37 +02:00
|
|
|
"""holds the location of the application data storage directory"""
|
2017-01-14 23:20:15 +01:00
|
|
|
|
2018-04-18 12:34:12 +02:00
|
|
|
shutdown = 0
|
2019-10-22 16:24:37 +02:00
|
|
|
"""
|
2019-11-04 11:27:19 +01:00
|
|
|
Set to 1 by the `.shutdown.doCleanShutdown` function.
|
|
|
|
Used to tell the threads to exit.
|
2019-10-22 16:24:37 +02:00
|
|
|
"""
|
2018-04-09 06:38:48 +02:00
|
|
|
|
|
|
|
# Component control flags - set on startup, do not change during runtime
|
|
|
|
# The defaults are for standalone GUI (default operating mode)
|
2019-10-22 16:24:37 +02:00
|
|
|
enableNetwork = True
|
|
|
|
"""enable network threads"""
|
|
|
|
enableObjProc = True
|
2019-11-04 11:27:19 +01:00
|
|
|
"""enable object processing thread"""
|
2019-10-22 16:24:37 +02:00
|
|
|
enableAPI = True
|
|
|
|
"""enable API (if configured)"""
|
|
|
|
enableGUI = True
|
|
|
|
"""enable GUI (QT or ncurses)"""
|
|
|
|
enableSTDIO = False
|
|
|
|
"""enable STDIO threads"""
|
2021-06-11 19:14:57 +02:00
|
|
|
enableKivy = False
|
|
|
|
"""enable kivy app and test cases"""
|
2017-02-02 15:48:56 +01:00
|
|
|
curses = False
|
|
|
|
|
2017-05-25 23:04:33 +02:00
|
|
|
maximumNumberOfHalfOpenConnections = 0
|
|
|
|
|
2019-11-05 17:54:04 +01:00
|
|
|
maximumLengthOfTimeToBotherResendingMessages = 0
|
|
|
|
|
2017-05-31 00:04:21 +02:00
|
|
|
ownAddresses = {}
|
|
|
|
|
2017-08-06 21:29:54 +02:00
|
|
|
discoveredPeers = {}
|
|
|
|
|
2018-02-03 11:46:39 +01:00
|
|
|
dandelion = 0
|
2018-04-05 11:50:34 +02:00
|
|
|
|
2022-01-11 15:45:42 +01:00
|
|
|
kivy = False
|
|
|
|
|
|
|
|
kivyapp = None
|
|
|
|
|
2018-04-05 11:50:34 +02:00
|
|
|
testmode = False
|
2018-07-05 15:37:16 +02:00
|
|
|
|
2019-11-05 17:54:04 +01:00
|
|
|
clientHasReceivedIncomingConnections = False
|
|
|
|
"""used by API command clientStatus"""
|
|
|
|
|
|
|
|
numberOfMessagesProcessed = 0
|
|
|
|
numberOfBroadcastsProcessed = 0
|
|
|
|
numberOfPubkeysProcessed = 0
|
|
|
|
|
2024-04-17 15:55:10 +02:00
|
|
|
statusIconColor = "red"
|
2019-11-05 17:54:04 +01:00
|
|
|
"""
|
|
|
|
GUI status icon color
|
|
|
|
.. note:: bad style, refactor it
|
|
|
|
"""
|
|
|
|
|
|
|
|
ackdataForWhichImWatching = {}
|
|
|
|
|
|
|
|
thisapp = None
|
|
|
|
"""Singleton instance"""
|
2022-10-21 12:28:20 +02:00
|
|
|
|
|
|
|
backend_py3_compatible = False
|
2024-04-17 15:55:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
class Placeholder(object): # pylint:disable=too-few-public-methods
|
|
|
|
"""Placeholder class"""
|
|
|
|
|
|
|
|
def __init__(self, className):
|
|
|
|
self.className = className
|
|
|
|
|
|
|
|
def __getattr__(self, name):
|
|
|
|
self._raise()
|
|
|
|
|
|
|
|
def __setitem__(self, key, value):
|
|
|
|
self._raise()
|
|
|
|
|
|
|
|
def __getitem__(self, key):
|
|
|
|
self._raise()
|
|
|
|
|
|
|
|
def _raise(self):
|
|
|
|
raise NotImplementedError(
|
|
|
|
"Probabaly you forgot to initialize state variable for {}".format(
|
|
|
|
self.className
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
Inventory = Placeholder("Inventory")
|
2024-04-21 17:24:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
Dandelion = Placeholder("Dandelion")
|