parameters: (db_name)
return_statement: return (db_path, db_type)
docstring: Identifies type of published database.
  
    Args:
      db_name: database name that is actually an DB asset path.
    Returns:
      (db_path, db_type): database path, type tuple.
    Raises:
      exceptions.Error in case of short database name.
docstring_summary: Identifies type of published database.
docstring_tokens: Identifies type of published database .
function: def IdentifyPublishedDb(db_name):
    """Identifies type of published database.
  
    Args:
      db_name: database name that is actually an DB asset path.
    Returns:
      (db_path, db_type): database path, type tuple.
    Raises:
      exceptions.Error in case of short database name.
    """
    if not db_name:
      raise exceptions.Error(
          "Internal Error - database name is an empty string.")
  
    db_path = os.path.normpath(db_name)
    db_type = None
  
    if db_path[-5:] == "/gedb":
      db_type = basic_types.DbType.TYPE_GE
    elif db_path[-6:] == "/mapdb":
      db_type = basic_types.DbType.TYPE_MAP
    else:
      db_ext = db_path[-4:]
      if db_ext == ".glb":
        db_type = basic_types.DbType.TYPE_GLB
      elif db_ext == ".glm":
        db_type = basic_types.DbType.TYPE_GLM
      elif db_ext == ".glc":
        db_type = basic_types.DbType.TYPE_GLC
      else:
        raise exceptions.Error(
            "Internal Error - Invalid database type for %s." % db_path)
  
    # Check for short database name for Fusion DB.
    if (db_type == basic_types.DbType.TYPE_GE or
        db_type == basic_types.DbType.TYPE_MAP):
      if db_name[0] != "/":
        raise exceptions.Error(
            "Internal Error - The short database name (%s) cannot be used." %
            db_name)
  
    return (db_path, db_type)
function_tokens: def IdentifyPublishedDb ( db_name ) : if not db_name : raise exceptions . Error ( "Internal Error - database name is an empty string." ) db_path = os . path . normpath ( db_name ) db_type = None if db_path [ - 5 : ] == "/gedb" : db_type = basic_types . DbType . TYPE_GE elif db_path [ - 6 : ] == "/mapdb" : db_type = basic_types . DbType . TYPE_MAP else : db_ext = db_path [ - 4 : ] if db_ext == ".glb" : db_type = basic_types . DbType . TYPE_GLB elif db_ext == ".glm" : db_type = basic_types . DbType . TYPE_GLM elif db_ext == ".glc" : db_type = basic_types . DbType . TYPE_GLC else : raise exceptions . Error ( "Internal Error - Invalid database type for %s." % db_path ) # Check for short database name for Fusion DB. if ( db_type == basic_types . DbType . TYPE_GE or db_type == basic_types . DbType . TYPE_MAP ) : if db_name [ 0 ] != "/" : raise exceptions . Error ( "Internal Error - The short database name (%s) cannot be used." % db_name ) return ( db_path , db_type )