move config read inside main function

This commit is contained in:
f97ada87 2017-09-27 00:36:02 +10:00
parent dbd12ab8b4
commit 08748fa9ae
No known key found for this signature in database
GPG Key ID: 07B327EEF97ADA87

View File

@ -198,9 +198,11 @@ if shared.useVeryEasyProofOfWorkForTesting:
defaults.networkDefaultPayloadLengthExtraBytes / 100)
class Main:
def start(self, daemon=False):
def start(self):
_fixSocket()
daemon = BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon')
try:
opts, args = getopt.getopt(sys.argv[1:], "hcd",
["help", "curses", "daemon"])
@ -406,8 +408,7 @@ All parameters are optional.
def main():
mainprogram = Main()
mainprogram.start(
BMConfigParser().safeGetBoolean('bitmessagesettings', 'daemon'))
mainprogram.start()
if __name__ == "__main__":
main()