init comar with sockname parameter (a feature for YALI).

This commit is contained in:
Barış Metin
2006-05-08 10:59:13 +00:00
parent 3a738a6ead
commit cfc51e4657
3 changed files with 9 additions and 2 deletions
+4 -1
View File
@@ -54,7 +54,8 @@ class Error(pisi.Error):
def init(database = True, write = True, def init(database = True, write = True,
options = None, ui = None, comar = True, options = None, ui = None, comar = True,
stdout = None, stderr = None): stdout = None, stderr = None,
comar_sockname = None):
"""Initialize PiSi subsystem""" """Initialize PiSi subsystem"""
# UI comes first # UI comes first
@@ -92,6 +93,8 @@ def init(database = True, write = True,
# TODO: this is definitely not dynamic beyond this point! # TODO: this is definitely not dynamic beyond this point!
ctx.comar = comar and not ctx.config.get_option('ignore_comar') ctx.comar = comar and not ctx.config.get_option('ignore_comar')
# This is for YALI, used in comariface.py:make_com()
ctx.comar_sockname = comar_sockname
# initialize repository databases # initialize repository databases
ctx.database = database ctx.database = database
+4 -1
View File
@@ -27,7 +27,10 @@ class Error(pisi.Error):
def make_com(): def make_com():
try: try:
import comar import comar
comard = comar.Link() if ctx.comar_sockname:
comard = comar.Link()
else:
comard = comar.Link(sockname=ctx.comar_sockname)
return comard return comard
except ImportError: except ImportError:
raise Error(_("COMAR: comard not fully installed")) raise Error(_("COMAR: comard not fully installed"))
+1
View File
@@ -44,6 +44,7 @@ repodb = None
invidx = None invidx = None
comar = None comar = None
comar_sockname = None
initialized = False initialized = False