config'i biraz düzenle.
This commit is contained in:
@@ -49,10 +49,10 @@ class Dirs:
|
||||
|
||||
class Flags:
|
||||
"""General flags used in actions API"""
|
||||
conf = pisi.config.config.conf
|
||||
host = conf.build.host
|
||||
cflags = conf.build.cflags
|
||||
cxxflags = conf.build.cflags
|
||||
values = pisi.config.config.values
|
||||
host = values.build.host
|
||||
cflags = values.build.cflags
|
||||
cxxflags = values.build.cflags
|
||||
|
||||
class ActionGlobals(pisi.config.Config):
|
||||
const = pisi.constants.const
|
||||
|
||||
@@ -48,8 +48,9 @@ class Command(object):
|
||||
username = self.options.username
|
||||
password = self.options.password
|
||||
if not username and not password:
|
||||
if config.username and config.password:
|
||||
self.authInfo = (config.username, config.password)
|
||||
if config.values.username and config.values.password:
|
||||
self.authInfo = (config.values.username,
|
||||
config..values.password)
|
||||
return
|
||||
elif username and password:
|
||||
self.authInfo = (username, password)
|
||||
|
||||
+2
-4
@@ -17,10 +17,8 @@ class Config(object):
|
||||
class configimpl:
|
||||
|
||||
def __init__(self):
|
||||
self.conf = ConfigurationFile("/etc/pisi/pisi.conf")
|
||||
self.destdir = self.conf.general.destinationdirectory
|
||||
self.username = self.conf.svn.username
|
||||
self.password = self.conf.svn.password
|
||||
self.values = ConfigurationFile("/etc/pisi/pisi.conf")
|
||||
self.destdir = self.values.general.destinationdirectory
|
||||
|
||||
# directory accessor functions
|
||||
# here is how it goes
|
||||
|
||||
@@ -68,6 +68,7 @@ class ConfigurationSection(object):
|
||||
|
||||
|
||||
class ConfigurationFile(object):
|
||||
"""Parse and get configuration values from the configuration file"""
|
||||
def __init__(self, filePath):
|
||||
parser = ConfigParser()
|
||||
self.filePath = filePath
|
||||
|
||||
Reference in New Issue
Block a user