def get_drone(hostname):
 if (hostname == 'localhost'):
  return _LocalDrone()
 try:
  return _RemoteDrone(hostname)
 except DroneUnreachable:
  return None

def get_drone ( hostname ) : if ( hostname == 'localhost' ) : return _LocalDrone ( ) try : return _RemoteDrone ( hostname ) except DroneUnreachable : return None
use this factory method to get drone objects .