Turns out sqlite connect requires a full path the ~ shortcut is not accepted
This commit is contained in:
parent
becf6dd45a
commit
aa286eb460
2 changed files with 5 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import sqlite3
|
import sqlite3
|
||||||
import CodiStatus
|
import CodiStatus
|
||||||
|
import getpass
|
||||||
|
|
||||||
def contactNameForNumber(number):
|
def contactNameForNumber(number):
|
||||||
for c in CodiStatus.Contacts:
|
for c in CodiStatus.Contacts:
|
||||||
|
|
@ -12,7 +13,7 @@ def refreshContacts():
|
||||||
CodiStatus.Contacts = []
|
CodiStatus.Contacts = []
|
||||||
|
|
||||||
try:
|
try:
|
||||||
conn = sqlite3.connect('~/.local/share/evolution/addressbook/system/contacts.db')
|
conn = sqlite3.connect('/home/'+getpass.getuser()+'/.local/share/evolution/addressbook/system/contacts.db')
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
statement = 'select * from folder_id'
|
statement = 'select * from folder_id'
|
||||||
contacts = c.execute(statement)
|
contacts = c.execute(statement)
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import Addressbook
|
||||||
import codi_mtk_generated_functions as mtkCmd
|
import codi_mtk_generated_functions as mtkCmd
|
||||||
import LEDManager
|
import LEDManager
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
import getpass
|
||||||
|
|
||||||
tapHistory = False
|
tapHistory = False
|
||||||
|
|
||||||
|
|
@ -79,7 +80,7 @@ def ActionCall(action, sim, line, numtype, msisdn, contact, contact_id):
|
||||||
if sim == 2:
|
if sim == 2:
|
||||||
ril = DBusServer.ril1
|
ril = DBusServer.ril1
|
||||||
ril.Dial(msisdn, '')
|
ril.Dial(msisdn, '')
|
||||||
conn = sqlite3.connect('~/.local/share/history-service/history.sqlite')
|
conn = sqlite3.connect('/home/'+getpass.getuser()+'/.local/share/history-service/history.sqlite')
|
||||||
try:
|
try:
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
statement = 'insert into voice_events values ("ofono/ofono/ril_0", "' + msisdn + \
|
statement = 'insert into voice_events values ("ofono/ofono/ril_0", "' + msisdn + \
|
||||||
|
|
@ -167,7 +168,7 @@ def CoDiOFF(par1, par2):
|
||||||
|
|
||||||
def GetCallHistory(index):
|
def GetCallHistory(index):
|
||||||
batchSize = 10
|
batchSize = 10
|
||||||
conn = sqlite3.connect('~/.local/share/history-service/history.sqlite')
|
conn = sqlite3.connect('/home/'+getpass.getuser()+'/.local/share/history-service/history.sqlite')
|
||||||
try:
|
try:
|
||||||
c = conn.cursor()
|
c = conn.cursor()
|
||||||
totalCdr = c.execute('select count(*) from voice_events').fetchall()[0][0]
|
totalCdr = c.execute('select count(*) from voice_events').fetchall()[0][0]
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue