r165 - branches/rewrite/src
Otavio Salvador
partial-mirror-devel@lists.alioth.debian.org
Tue, 06 Jul 2004 17:33:57 -0600
Author: otavio
Date: Tue Jul 6 17:33:56 2004
New Revision: 165
Modified:
branches/rewrite/src/Config.py
Log:
Change the lists to protected.
Modified: branches/rewrite/src/Config.py
==============================================================================
--- branches/rewrite/src/Config.py (original)
+++ branches/rewrite/src/Config.py Tue Jul 6 17:33:56 2004
@@ -62,7 +62,7 @@
Store the configurations used by our system.
"""
- required_in_global = [
+ _required_in_global = [
'mirror_dir',
'architectures',
'sections',
@@ -72,12 +72,12 @@
'get_provides',
]
- allowed_in_global = [
+ _allowed_in_global = [
'debug',
]
### HACK. Split out later to generalize section types better.
- allowed_in_mirror_backend = [
+ _allowed_in_mirror_backend = [
'server',
'architectures',
'sections',
@@ -91,14 +91,14 @@
'resolve_deps_using',
]
- allowed_in_merge_backend = [
+ _allowed_in_merge_backend = [
'filter_@BACKEND@',
'backends',
'name',
]
# if not included here, it's string
- options_with_type = {
+ _options_with_type = {
'architectures': 'list',
'backends': 'list',
'distributions': 'list',
@@ -117,14 +117,14 @@
# Read the global section.
self.confs = {}
self.confs['GLOBAL'] = {}
- global_items = self.allowed_in_global + self.required_in_global
+ global_items = self._allowed_in_global + self._required_in_global
for item, value in self.items('GLOBAL'):
if item not in global_items:
debug("[%s] is not allowed in global section." % (item))
raise InvalidOption('GLOBAL', item)
self.confs['GLOBAL'][item] = value
- for item in self.required_in_global:
+ for item in self._required_in_global:
if not self.confs['GLOBAL'].has_key(item):
debug("Required option [%s] not found in global section." % (item))
raise RequiredOptionMissing('GLOBAL', item)
@@ -135,10 +135,10 @@
###HACK. Split this out later into subclasses.
# detect which config type this is
- if 'backends' in self.options(section):
- allowed_in_section = self.allowed_in_merge_backend
- elif 'server' in self.options(section):
- allowed_in_section = self.allowed_in_mirror_backend
+ if 'backends' in self._options(section):
+ allowed_in_section = self._allowed_in_merge_backend
+ elif 'server' in self._options(section):
+ allowed_in_section = self._allowed_in_mirror_backend
else:
debug("Unknown section type in section [%s]." % (section))
raise InvalidSection(section)
@@ -191,12 +191,12 @@
debug("[%s] is not present in section [%s]." % (option, section))
raise InvalidOption(section, option)
- if option in self.options_with_type:
- if self.options_with_type[option] == 'list':
+ if option in self._options_with_type:
+ if self._options_with_type[option] == 'list':
return conf.split()
- elif self.options_with_type[option] == 'boolean':
+ elif self._options_with_type[option] == 'boolean':
return bool(conf)
-# elif self.options_with_type[option] == 'dict':
+# elif self._options_with_type[option] == 'dict':
# return map(conf.split())
else:
return conf