From 4d88db19c5024c4cca4ee4579415425193518fb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Thu, 29 Sep 2005 17:53:28 +0000 Subject: [PATCH] * fix: true'yla false karismis zaten oh oh * option almak icin bir yardimci rutin --- pisi/api.py | 7 +------ pisi/config.py | 6 ++++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pisi/api.py b/pisi/api.py index 96e7f5ab..1f5dda4f 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -46,12 +46,7 @@ def init(database = True, options = None, ui = None ): import pisi.config ctx.config = pisi.config.Config(options) - init_comar = False - if ctx.config.options: - if hasattr(ctx.config.options, 'ignore_comar'): - if ctx.config.options.ignore_comar: - init_comar = True - if init_comar: + if not ctx.config.get_option('ignore_comar'): # FIXME: just try for others (that don't use comar) try: import comar diff --git a/pisi/config.py b/pisi/config.py index ee1bc82b..6939fd16 100644 --- a/pisi/config.py +++ b/pisi/config.py @@ -28,6 +28,12 @@ class Config(object): self.values = ConfigurationFile("/etc/pisi/pisi.conf") self.destdir = self.values.general.destinationdirectory + def get_option(self, opt): + if self.options: + if hasattr(self.options, opt): + return getattr(self.options, opt) + return None + # directory accessor functions # here is how it goes # x_dir: system wide directory for storing info type x