
    h                         d dl Z d dlZd ZdS )    Nc            	         t          j        t          j        d          t	          t          j        dd                    t          j        d          t          j        d          t          j        d          t           j        j                  } 	 |                                 5 }|                    d           |	                                }|rd	|vsd
|vrt          d          t          |d	                   t          |d
                   z   }d|icd d d            |                                  S # 1 swxY w Y   	 |                                  d S # |                                  w xY w)NDB_HOSTDB_PORTi  DB_USERDB_PASSDB_NAME)hostportuserpassworddatabasecursorclassz
                SELECT IPV, MPV
                FROM pensavT
                ORDER BY Date DESC
                LIMIT 1
            IPVMPVzMissing IPV or MPV in DB rowstart_value)pymysqlconnectosgetenvintcursors
DictCursorcursorexecutefetchone
ValueErrorfloatclose)connr   rowtotal_values       #/var/www/html/api/test_pensav_db.py
fetch_datar#      s   ?Yy!!9d++,,Yy!!9%%9%%O.  D[[]] 	fNN     //##C A%s**e3.>.> !?@@@E
++eCJ.?.??K {	 	 	 	 	 	 	& 	

'	 	 	 	 	 	 	 	 	& 	



s1   E 'A1D9E 9D==E  D=E E1)r   r   r#        r"   <module>r&      s0    				     r%   