Esempio n. 1
0
def main():
  myMap = CvtdMap()
  command = "help"
  while command not in ["quit", "exit", "q", "e"]:
    if command == "1":
      new_street(myMap)
    elif command == "2":
      search_streets(myMap)
    elif command == "3":
      pass
    elif command == "4":
      search_nodes(myMap)
    elif command == "5":
      new_route(myMap)
    elif command == "6":
      pass
    elif command == "7":
      pass
    elif command == "8":
      pass
    elif command == "11":
      myMap.import_google_directory()
    elif command == "12":
      import_osm(myMap)
    elif command == 'v':
      myMap.validate()
    elif command.lower().strip().split()[0] in ['r', 'read', 'o', 'open']:
      myMap.read_roads(get_filename(command))
    elif command.lower().strip().split()[0] in ['w', 'write', 's', 'save']:
      myMap.write_roads(get_filename(command))
    else:
      show_help()
    command = input("\n>>> ")

  print("ROAD LIST COUNT = {}".format(len(myMap.roadList)))
Esempio n. 2
0
def main():
    with open('key.txt', 'r') as f:
        key = f.read()

    myMap = CvtdMap()
    locator = CvtdBusLocator('locator/')
    locator.read_locator()
    command = "help"
    while command not in ["quit", "exit", "q", "e"]:
        if command == "":
            pass
        elif command == "1":
            pull(myMap, locator, 1, key)
        elif command[0] == "2":
            list_locator(myMap, locator, command)
        elif command == "3":
            myMap.import_google_directory()
        elif command.lower().strip().split()[0] in ['r', 'read', 'o', 'open']:
            myMap.read_roads(get_filename(command))
        else:
            show_help()
        command = input("\n>>> ")