Ejemplo n.º 1
0
def main():
    if len(sys.argv) != 2:
        print 'Invalid number of arguments: <mongoose> <mongoose src code>'
        exit(1)
    src = open(sys.argv[1])
    backend.walk_ast(parser.parse(src.read()))
    backend.run()
Ejemplo n.º 2
0
def main():
    if len(sys.argv) != 2:
        print 'Invalid number of arguments: <mongoose> <mongoose src code>'
        exit(1)
    src = open(sys.argv[1])
    backend.walk_ast(parser.parse(src.read()))
    backend.run()
from backend import backend

if __name__ == '__main__':
    backend.run(debug=True, port=5000, host='0.0.0.0')
Ejemplo n.º 4
0
    with open(fname, "rb") as fp:
        ctrl = ClientController()
        for line in fp:
            line = line.strip()
            obj = json.loads(line)

            if obj["ip"] != None and obj["date"] >= 1515899912:
                print("conn   " + obj["ip"] + " date " + str(obj["date"]))
                obj["backend_username"] = username
                try:
                    ctrl.put_session(obj)
                except:
                    print("Cannot Put Session")
                    print("----------------------------")
                    traceback.print_exc()
                    print("----------------------------")
                    print(repr(obj))
                    sys.exit(0)
    sys.exit(0)

if len(sys.argv) > 1:
    print("Unknown action '" + sys.argv[1] + "'")
    print("Available commands:")
    print("    import file.json : imports raw og file")
    print("    cleardb          : deletes all data from db")
    print("To simply start the backend, use no command at all")
    sys.exit(0)

from backend.backend import run
run()
Ejemplo n.º 5
0
#!/usr/bin/env python
from backend import backend

backend.run(debug=True)
Ejemplo n.º 6
0
from backend import backend

if __name__ == "__main__":
    backend.run()