Be consistent, always use ctx. ctx will die too. soon.
This commit is contained in:
+6
-2
@@ -134,8 +134,12 @@ def finalize():
|
|||||||
ctx.loghandler.flush()
|
ctx.loghandler.flush()
|
||||||
ctx.log.removeHandler(ctx.loghandler)
|
ctx.log.removeHandler(ctx.loghandler)
|
||||||
|
|
||||||
pisi.db.repodb.finalize()
|
if ctx.repodb:
|
||||||
pisi.db.installdb.finalize()
|
ctx.repodb.finalize()
|
||||||
|
ctx.repodb = None
|
||||||
|
if ctx.installdb:
|
||||||
|
ctx.installdb.finalize()
|
||||||
|
ctx.installdb = None
|
||||||
if ctx.filesdb != None:
|
if ctx.filesdb != None:
|
||||||
ctx.filesdb.close()
|
ctx.filesdb.close()
|
||||||
ctx.filesdb = None
|
ctx.filesdb = None
|
||||||
|
|||||||
@@ -525,7 +525,7 @@ class Remove(AtomicOperation):
|
|||||||
def remove_db(self, txn):
|
def remove_db(self, txn):
|
||||||
ctx.installdb.remove(self.package_name, txn)
|
ctx.installdb.remove(self.package_name, txn)
|
||||||
ctx.filesdb.remove_files(self.files, txn)
|
ctx.filesdb.remove_files(self.files, txn)
|
||||||
pisi.db.packagedb.remove_tracking_package(self.package_name, txn)
|
ctx.packagedb.remove_tracking_package(self.package_name, txn)
|
||||||
|
|
||||||
|
|
||||||
def remove_single(package_name):
|
def remove_single(package_name):
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ __trans = gettext.translation('pisi', fallback=True)
|
|||||||
_ = __trans.ugettext
|
_ = __trans.ugettext
|
||||||
|
|
||||||
import pisi.context as ctx
|
import pisi.context as ctx
|
||||||
#import pisi.db.packagedb as packagedb
|
import pisi.db.packagedb as packagedb
|
||||||
from pisi.version import Version
|
from pisi.version import Version
|
||||||
import pisi.pxml.autoxml as autoxml
|
import pisi.pxml.autoxml as autoxml
|
||||||
import pisi.db.itembyrepodb
|
import pisi.db.itembyrepodb
|
||||||
|
|||||||
Reference in New Issue
Block a user