From fda5d23c2d93e23f5ef14c63ab539a37cba74702 Mon Sep 17 00:00:00 2001
From: lakshyacis <lakshya.p@cisinlabs.com>
Date: Tue, 22 Oct 2019 19:54:37 +0530
Subject: [PATCH] state quality fixes

---
 src/state.py | 56 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 35 insertions(+), 21 deletions(-)

diff --git a/src/state.py b/src/state.py
index 3e051edf..a3b930ab 100644
--- a/src/state.py
+++ b/src/state.py
@@ -1,30 +1,42 @@
+"""
+Global runtime variables.
+"""
 import collections
 
 neededPubkeys = {}
 streamsInWhichIAmParticipating = []
 
-# For UPnP
 extPort = None
+"""For UPnP"""
 
-# for Tor hidden service
 socksIP = None
+"""for Tor hidden service"""
 
-appdata = ''  # holds the location of the application data storage directory
+appdata = ''
+"""holds the location of the application data storage directory"""
 
-# Set to 1 by the doCleanShutdown function.
-# Used to tell the proof of work worker threads to exit.
 shutdown = 0
+"""
+    Set to 1 by the doCleanShutdown function.
+    Used to tell the proof of work worker threads to exit.
+"""
 
 # Component control flags - set on startup, do not change during runtime
 #     The defaults are for standalone GUI (default operating mode)
-enableNetwork = True  # enable network threads
-enableObjProc = True  # enable object processing threads
-enableAPI = True  # enable API (if configured)
-enableGUI = True  # enable GUI (QT or ncurses)
-enableSTDIO = False  # enable STDIO threads
+enableNetwork = True
+"""enable network threads"""
+enableObjProc = True
+"""enable object processing threads"""
+enableAPI = True
+"""enable API (if configured)"""
+enableGUI = True
+"""enable GUI (QT or ncurses)"""
+enableSTDIO = False
+"""enable STDIO threads"""
 curses = False
 
-sqlReady = False  # set to true by sqlTread when ready for processing
+sqlReady = False
+"""set to true by sqlTread when ready for processing"""
 
 maximumNumberOfHalfOpenConnections = 0
 
@@ -35,17 +47,19 @@ uploadThread = None
 
 ownAddresses = {}
 
-# If the trustedpeer option is specified in keys.dat then this will
-# contain a Peer which will be connected to instead of using the
-# addresses advertised by other peers. The client will only connect to
-# this peer and the timing attack mitigation will be disabled in order
-# to download data faster. The expected use case is where the user has
-# a fast connection to a trusted server where they run a BitMessage
-# daemon permanently. If they then run a second instance of the client
-# on a local machine periodically when they want to check for messages
-# it will sync with the network a lot faster without compromising
-# security.
 trustedPeer = None
+"""
+    If the trustedpeer option is specified in keys.dat then this will
+    contain a Peer which will be connected to instead of using the
+    addresses advertised by other peers. The client will only connect to
+    this peer and the timing attack mitigation will be disabled in order
+    to download data faster. The expected use case is where the user has
+    a fast connection to a trusted server where they run a BitMessage
+    daemon permanently. If they then run a second instance of the client
+    on a local machine periodically when they want to check for messages
+    it will sync with the network a lot faster without compromising
+    security.
+"""
 
 discoveredPeers = {}