From 92717f69db0c3850d7f235e7bde4b5e66a9741a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Mon, 18 Jul 2005 18:30:32 +0000 Subject: [PATCH] =?UTF-8?q?auth=20bilgisi=20her=20host=20i=C3=A7in=20farkl?= =?UTF-8?q?=C4=B1=20olacak.=20bunun=20d=C4=B1=C5=9F=C4=B1nda=20her=20kulla?= =?UTF-8?q?n=C4=B1c=C4=B1=20i=C3=A7in=20de=20farkl=C4=B1=20olabilir.=20bu?= =?UTF-8?q?=20y=C3=BCzden=20configfile'da=20bunu=20tutmak=20mant=C4=B1kl?= =?UTF-8?q?=C4=B1=20de=C4=9Fil.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi/cli/commands.py | 16 ++++++++++------ pisi/configfile.py | 27 +++++++++++++-------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/pisi/cli/commands.py b/pisi/cli/commands.py index 69ba01dd..b7ca77ec 100644 --- a/pisi/cli/commands.py +++ b/pisi/cli/commands.py @@ -47,12 +47,16 @@ class Command(object): def checkAuthInfo(self): username = self.options.username password = self.options.password - if not username and not password: - if config.values.svn.username and config.values.svn.password: - self.authInfo = (config.values.svn.username, - config.values.svn.password) - return - elif username and password: + + # We'll get the username, password pair from a configuration + # file from users home directory. Currently we need user to + # give it from the user interface. +# if not username and not password: +# if someauthconfig.username and someauthconfig.password: +# self.authInfo = (someauthconfig.username, +# someauthconfig.password) +# return + if username and password: self.authInfo = (username, password) return diff --git a/pisi/configfile.py b/pisi/configfile.py index 9b00c631..59740453 100644 --- a/pisi/configfile.py +++ b/pisi/configfile.py @@ -1,3 +1,5 @@ +# -*- conding: utf-8 -*- + # PISI Configuration File module, obviously, is used to read from the # configuration file. Module also defines default values for # configuration parameters. @@ -13,9 +15,11 @@ #CFLAGS= -mcpu=i686 -O2 -pipe -fomit-frame-pointer #CXXFLAGS= -mcpu=i686 -O2 -pipe -fomit-frame-pointer # -#[svn] -#username = caglar -#password = isteoylebirsey +#[dirs] +#lib_dir = /var/lib/pisi +#db_dir = /var/db/pisi +#archives_dir = /var/cache/pisi/archives +#tmp_dir = /var/tmp/pisi import os from ConfigParser import ConfigParser, NoSectionError @@ -43,9 +47,12 @@ class DirsDefaults: archives_dir = "/var/cache/pisi/archives" tmp_dir = "/var/tmp/pisi" -class SvnDefaults: - """Default values for [svn] section """ - username = password = None +# bu bilgiyi burada tutmak mantıklı değil. bunun yerine kullanıcının +# kendi ev dizininde ayrı bir dosyada tutmak gerekiyor. Şimdilik bunu +# desteklemeyelim. Sonra hallederiz... +# class SvnDefaults: +# """Default values for [svn] section """ +# username = password = None class ConfigurationSection(object): """ConfigurationSection class defines a section in the configuration @@ -59,8 +66,6 @@ class ConfigurationSection(object): self.defaults = BuildDefaults elif section == "directories": self.defaults = DirsDefaults - elif section == "svn": - self.defaults = SvnDefaults else: e = "No section by name '%s'" % section raise ConfigException, e @@ -103,9 +108,3 @@ class ConfigurationFile(object): except NoSectionError: dirsitems = [] self.dirs = ConfigurationSection("directories", dirsitems) - - try: - svnitems = parser.items("svn") - except NoSectionError: - svnitems = [] - self.svn = ConfigurationSection("svn", svnitems)