server/inputs.py
def input_location_center(addr) -> tuple:
    ''' finds the lat and long (center) with user's given location '''
    user_input = addr
    # initialize variable
    latitude = 0
    longitude = 0
    if user_input.startswith('CENTER NOMINATIM '):
        
        center = _get_location(user_input)
        center = center.replace(',', '')
        latitude, longitude = api_class.run_search_center(center)
        
        
        return latitude, longitude

    elif user_input.startswith('CENTER FILE '):
        while True:
            try:
                d = ''
                # FIND FILE PATH DIRECTORY
                center = _get_path(user_input)
                with open(center, encoding = 'utf8') as f:
                    d = json.load(f)
                
                latitude, longitude = api_class.run_search_offline(d)
                
        
            except:
                print('FAILED')
                print(center)
                if d == ' ':
                    print('FORMAT')
                else:
                    print('MISSING')
                
            finally:
                break
                
                
        return latitude, longitude
 finds the lat and long (center) with user's given location 
finds the lat and long (center) with user's given location
finds the lat and long ( center ) with user ' s given location
def input_location_center(addr) -> tuple:
    user_input = addr
    latitude = 0
    longitude = 0
    if user_input.startswith('CENTER NOMINATIM '):
        center = _get_location(user_input)
        center = center.replace(',', '')
        latitude, longitude = api_class.run_search_center(center)
        return latitude, longitude
    elif user_input.startswith('CENTER FILE '):
        while True:
            try:
                d = ''
                center = _get_path(user_input)
                with open(center, encoding = 'utf8') as f:
                    d = json.load(f)
                latitude, longitude = api_class.run_search_offline(d)
            except:
                print('FAILED')
                print(center)
                if d == ' ':
                    print('FORMAT')
                else:
                    print('MISSING')
            finally:
                break
        return latitude, longitude
def input_location_center ( addr ) -> tuple : user_input = addr latitude = 0 longitude = 0 if user_input . startswith ( 'CENTER NOMINATIM ' ) : center = _get_location ( user_input ) center = center . replace ( ',' , '' ) latitude , longitude = api_class . run_search_center ( center ) return latitude , longitude elif user_input . startswith ( 'CENTER FILE ' ) : while True : try : d = '' center = _get_path ( user_input ) with open ( center , encoding = 'utf8' ) as f : d = json . load ( f ) latitude , longitude = api_class . run_search_offline ( d ) except : print ( 'FAILED' ) print ( center ) if d == ' ' : print ( 'FORMAT' ) else : print ( 'MISSING' ) finally : break return latitude , longitude
finds the lat and long (center) with user's given location
finds the lat and long ( center ) with user ' s given location
''' finds the lat and long (center) with user's given location ''' # initialize variable # FIND FILE PATH DIRECTORY
addr