import commands


# Entry point for raw input
def process_command(raw_data):
    command = parse_command(raw_data)
    response = route_command(command)
    return response


# Currently it offers a very simple solution to split the string by ' ' (space character)
def parse_command(string):
    return string.split(" ")


# Route a command to a respective handler
def route_command(command):

    root_command = command[0].lower()

    if root_command == "camera":
        return commands.camera.proc(command)

    elif root_command == "help":
        return commands.help.proc(command)

    elif root_command == "lights":
        return commands.lights.proc(command)

    elif root_command == "subscribe":
        return commands.subscribe.proc(command)

    else:
        return commands.default.proc(command)

@@ -1,8 +1,44 @@
+from importlib import import_module%0A
 import c
@@ -466,31 +466,31 @@
 ()%0A%0A    
-if root
+allowed
 _command
  == %22cam
@@ -485,310 +485,191 @@
 mand
- == %22camera%22:%0A        return commands.camera.proc(command)%0A%0A    elif root_command == %22help%22:
+s = %5B%0A        %22camera%22, %22help%22, %22lights%22, %22subscribe%22
 %0A    
+%5D%0A%0A
     
-return commands.help.proc(command)%0A%0A    elif root_command == %22lights%22:%0A        return commands.lights.proc(command)%0A%0A    elif root_command == %22subscribe%22:%0A        return commands.subscribe.
+if root_command in allowed_commands:%0A        return getattr(import_module(f%22commands.%7Broot_command%7D%22), %22
 proc
+%22)
 (command
 )%0A%0A 
@@ -664,16 +664,20 @@
 (command
+%5B1:%5D
 )%0A%0A    e
@@ -696,16 +696,39 @@
  return 
+getattr(import_module(%22
 commands
@@ -739,19 +739,25 @@
 ault
-.
+%22), %22
 proc
+%22)
 (command
 )%0A
@@ -746,18 +746,22 @@
  %22proc%22)(command
+%5B1:%5D
 )%0A

Fix module importing