diff options
author | Brian Dolbec <brian.dolbec@gmail.com> | 2011-02-23 22:17:00 -0800 |
---|---|---|
committer | Brian Dolbec <brian.dolbec@gmail.com> | 2011-03-26 19:39:13 -0700 |
commit | f0f43429d260c9afa4bdda394e86a9b258e29150 (patch) | |
tree | a31d4c86871f3f25eb25660b8682df4a73fa3d26 | |
parent | a9fe3d3dc2794ab46af1b68728aa7a12f0733f49 (diff) | |
download | layman-f0f43429d260c9afa4bdda394e86a9b258e29150.tar.gz layman-f0f43429d260c9afa4bdda394e86a9b258e29150.tar.bz2 layman-f0f43429d260c9afa4bdda394e86a9b258e29150.zip |
create a new create_overlay_dict() to assist in using a python dictionary for overlay definitions
-rw-r--r-- | layman/utils.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/layman/utils.py b/layman/utils.py index 67a0ab7..86524ef 100644 --- a/layman/utils.py +++ b/layman/utils.py @@ -175,6 +175,31 @@ def delete_empty_directory(mdir, output=OUT): if getpass.getuser() != 'root': output.warn('Hint: You are not root.') + +def create_overlay_dict(**kwargs): + """Creates a complete empty reository definition. + Then fills it with values passed in + """ + result = { + 'name': '', + 'owner_name': '', + 'owner_email': '', + 'homepage': '', + 'irc': '', + 'description': '', + 'feeds': [], + 'sources': [('','','')], + 'priority': 50, + 'quality': u'experimental', + 'status': '', + 'official': False, + 'supported': False, + } + for key in kwargs: + result[key] = kwargs[key] + return result + + #=============================================================================== # # Testing |