aboutsummaryrefslogtreecommitdiff
path: root/ipsutils/config.py
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2013-06-05 15:19:33 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2013-06-05 15:19:33 -0400
commit4855e0182b6303ace9c1ba1410a2354ef44be1ea (patch)
treedbf877421bcd7181beae78b40f32c065da23ff25 /ipsutils/config.py
parent744c45857bf277de6598d45134dc4e62ea0ebb98 (diff)
downloadipsutils-4855e0182b6303ace9c1ba1410a2354ef44be1ea.tar.gz
Replace standard dictionaries with ordered dictionaries
Diffstat (limited to 'ipsutils/config.py')
-rw-r--r--ipsutils/config.py49
1 files changed, 26 insertions, 23 deletions
diff --git a/ipsutils/config.py b/ipsutils/config.py
index 3ef79f8..bd5b8ce 100644
--- a/ipsutils/config.py
+++ b/ipsutils/config.py
@@ -15,33 +15,36 @@
import shlex
import string
import StringIO
+import collections
class Config(object):
- def __init__(self, ipsfile):
+ def __init__(self, ipsfile=''):
super(Config, self).__init__()
- key_dict = {
- 'name': '',
- 'repackage': '',
- 'version': '',
- 'release': '',
- 'maintainer': '',
- 'group': '',
- 'upstream_url': '',
- 'source_url': '',
- 'description': '',
- 'summary': '',
- 'classification': '',
- 'arch': '',
- 'license': ''
- }
+ key_dict = collections.OrderedDict()
+ key_dict['name'] = ''
+ key_dict['repackage'] = ''
+ key_dict['version'] = ''
+ key_dict['release'] = ''
+ key_dict['group'] = ''
+ key_dict['summary'] = ''
+ key_dict['license'] = ''
+ key_dict['maintainer'] = ''
+ key_dict['upstream_url'] = ''
+ key_dict['source_url'] = ''
+ key_dict['arch'] = ''
+ key_dict['classification'] = ''
+ key_dict['description'] = ''
- script_dict = {
- 'build': [],
- 'prep': [],
- 'install': [],
- 'transforms': [],
- 'files': []
- }
+ script_dict = collections.OrderedDict()
+ script_dict['prep'] = []
+ script_dict['build'] = []
+ script_dict['install'] = []
+ script_dict['transforms'] = []
+
+ if not ipsfile:
+ self.key_dict = key_dict
+ self.script_dict = script_dict
+ return
#Initial key_dict population with raw values taken from ips file
for key in key_dict: