From 7d3e7e7a30c3437e3692e0e8ea715c8f35ea8264 Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Sun, 10 Jun 2018 03:00:01 -0500 Subject: [PATCH] started work on communicator2 --- onionr/communicator2.py | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 onionr/communicator2.py diff --git a/onionr/communicator2.py b/onionr/communicator2.py new file mode 100644 index 00000000..a1594b8d --- /dev/null +++ b/onionr/communicator2.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +''' + Onionr - P2P Microblogging Platform & Social network. + + This file contains both the OnionrCommunicate class for communcating with peers + and code to operate as a daemon, getting commands from the command queue database (see core.Core.daemonQueue) +''' +''' + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +''' +import core, config, onionrblockapi as block +class OnionrDaemon: + def __init__(self, debug, developmentMode): + self.timers = [] # list of tuples, function, time in seconds + self.nodeInfo + return + +shouldRun = False +debug = True +developmentMode = False +if config.get('devmode', True): + developmentMode = True +try: + if sys.argv[1] == 'run': + shouldRun = True +except IndexError: + pass +if shouldRun: + try: + OnionrCommunicate(debug, developmentMode) + except KeyboardInterrupt: + sys.exit(1) + pass