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