Skip to content

Commit

Permalink
argparse
Browse files Browse the repository at this point in the history
  • Loading branch information
abagali1 committed May 31, 2020
1 parent c9f4be4 commit 0e5046e
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions src/main.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,31 @@
import os
import sys
import json
import time
import argparse

from hermes import Hermes
from threading import Thread

BASE_DIR = os.path.abspath(os.path.dirname(__file__))

try:
from MainControlLoop import main_control_loop as mcl
except ImportError:
raise RuntimeError("Unable to import pFS Main Control Loop, are you in the pFS directory?")

def hermes_thread(hermes):
while True:
time.sleep(0.1)
hermes.run()


def main():

parser = argparse.ArgumentParser()
parser.add_argument("-c", "--config", help="HERMES configuration file",)
args = parser.parse_args()

with open(args.config, 'r') as f:
config = json.load(f)


def ingest(inp):
print(inp)


def main():
# parser = argparse.ArgumentParser(description="Pass some arguments")
# parser.add_argument('--live', dest='live', const=True, default=False, nargs='*')
# args = parser.parse_args()
config = json.load(open("config.json"))
hermes = Hermes(config)
thread = Thread(target=hermes_thread, args=(hermes,))
thread.daemon = True
thread.start()

while True:
if True:
# if args.live:
inp = input()
ingest(inp)


if __name__ == '__main__':
Expand Down

0 comments on commit 0e5046e

Please sign in to comment.