[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, debian, updated. upstream/0.9.5.5-717-g0f98819

Sebastian Krzyszkowiak seba.dos1 at gmail.com
Sat Aug 6 08:17:21 UTC 2011


The following commit has been merged in the debian branch:
commit 51d650f91f3e002f23567a0f33c6359cce7f970a
Author: Sebastian Krzyszkowiak <seba.dos1 at gmail.com>
Date:   Fri Jul 10 22:12:26 2009 +0200

    opimd: SQLite-Calls: provide some fields as float and some as int

diff --git a/framework/subsystems/opimd/pimb_sqlite_calls.py b/framework/subsystems/opimd/pimb_sqlite_calls.py
index 399156c..247c37e 100644
--- a/framework/subsystems/opimd/pimb_sqlite_calls.py
+++ b/framework/subsystems/opimd/pimb_sqlite_calls.py
@@ -117,6 +117,8 @@ class SQLiteCallBackend(Backend):
     def load_entries_from_db(self):
         """Loads all entries from db"""
         keys = {0:'_backend_entry_id', 1:'Type', 2:'Timestamp', 3:'Timezone', 4:'Direction', 5:'Duration', 6:'Cost', 7:'Answered', 8:'New', 9:'Replied'}
+        floatKeys = ['Timestamp', 'Duration']
+        intKeys = ['Answered', 'New', 'Replied']
         cur = self.con.cursor()
         try:
             cur.execute('SELECT id, Type, Timestamp, Timezone, Direction, Duration, Cost, Answered, New, Replied FROM calls WHERE deleted=0')
@@ -128,7 +130,12 @@ class SQLiteCallBackend(Backend):
         for line in lines:
             entry = {}
             for key in keys:
-                entry[keys[key]] = line[key]
+                if key in floatKeys:
+                    entry[keys[key]] = float(line[key])
+                elif key in intKeys:
+                    entry[keys[key]] = int(line[key])
+                else:
+                    entry[keys[key]] = line[key]
             try:
                 cur.execute('SELECT Field, Value FROM call_values WHERE callId=?',(line[0],))
                 for pair in cur:

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list