scripts/export/rfam_xml_dumper.py
def fetch_value(query, accession):
    """
    Retrieves and returns a value from the database depending to the query
    executed. The query should return a single value

    query:  The query to be executed in the form of string.
    accession:  Rfam specific accession (family, clan, motif)
                to execute the query on
    """

    cnx = RfamDB.connect()

    cursor = cnx.cursor(raw=True)

    if accession is not None:
        cursor.execute(query % accession)

    else:
        cursor.execute(query)

    value = cursor.fetchall()

    cursor.close()
    cnx.disconnect()

    if len(value) > 0:
        return value[0][0]

    return None

    Retrieves and returns a value from the database depending to the query
    executed. The query should return a single value

    query:  The query to be executed in the form of string.
    accession:  Rfam specific accession (family, clan, motif)
                to execute the query on
    
Retrieves and returns a value from the database depending to the query
executed. The query should return a single value

The query to be executed in the form of string.
accession:  Rfam specific accession (family, clan, motif)
to execute the query on
Retrieves and returns a value from the database depending to the query executed . The query should return a single value The query to be executed in the form of string . accession : Rfam specific accession ( family clan motif ) to execute the query on
def fetch_value(query, accession):
    cnx = RfamDB.connect()
    cursor = cnx.cursor(raw=True)
    if accession is not None:
        cursor.execute(query % accession)
    else:
        cursor.execute(query)
    value = cursor.fetchall()
    cursor.close()
    cnx.disconnect()
    if len(value) > 0:
        return value[0][0]
    return None
def fetch_value ( query , accession ) : cnx = RfamDB . connect ( ) cursor = cnx . cursor ( raw = True ) if accession is not None : cursor . execute ( query % accession ) else : cursor . execute ( query ) value = cursor . fetchall ( ) cursor . close ( ) cnx . disconnect ( ) if len ( value ) > 0 : return value [ 0 ] [ 0 ] return None
Retrieves and returns a value from the database depending to the query
executed.
Retrieves and returns a value from the database depending to the query executed .
"""
    Retrieves and returns a value from the database depending to the query
    executed. The query should return a single value

    query:  The query to be executed in the form of string.
    accession:  Rfam specific accession (family, clan, motif)
                to execute the query on
    """
query
accession