Skip to content

Commit

Permalink
Last index is saved per paradox database file, not per task (task poi…
Browse files Browse the repository at this point in the history
…nts to paradox database folder that may contain many database files).
  • Loading branch information
grigoryvp committed Mar 2, 2012
1 parent 9b3a328 commit 8e06ff4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 0 additions & 2 deletions parabridge_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ def processParadoxFile( self, i_sSrc, i_sDst ) :
try :
oDb = pyparadox.open( i_sSrc, shutdown = self.m_oShutdown )
except pyparadox.Shutdown :
print( "shutdown catched" )
return False
return True

def shutdown( self ) :
self.m_fShutdown = True
##! After |m_fShutdown| is set to prevent races.
print( "shutdown set" )
self.m_oShutdown.set()

@classmethod
Expand Down
10 changes: 4 additions & 6 deletions settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@
guid TEXT,
name TEXT UNIQUE,
src TEXT,
dst TEXT,
index_last INTEGER)"""
SQL_TASK_ADD = """INSERT INTO task (guid, name, src, dst, index_last)
VALUES (:guid, :name, :src, :dst, :index_last)"""
dst TEXT)"""
SQL_TASK_ADD = """INSERT INTO task (guid, name, src, dst)
VALUES (:guid, :name, :src, :dst)"""
SQL_TASK_LIST = """SELECT * FROM task"""
SQL_TASK_DEL_BY_NAME = """DELETE FROM task WHERE name = :name"""

Expand Down Expand Up @@ -49,8 +48,7 @@ def taskAdd( self, i_sName, i_sSrc, i_sDst ) :
'guid' : str( uuid.uuid4() ),
'name' : i_sName,
'src' : i_sSrc,
'dst' : i_sDst,
'index_last' : 0 }
'dst' : i_sDst }
oConn.execute( SQL_TASK_ADD, mValues )
except sqlite3.IntegrityError :
## Name not unique.
Expand Down

0 comments on commit 8e06ff4

Please sign in to comment.