1 |
commit: f0f43429d260c9afa4bdda394e86a9b258e29150 |
2 |
Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
3 |
AuthorDate: Thu Feb 24 06:17:00 2011 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Sun Mar 27 02:39:13 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/layman.git;a=commit;h=f0f43429 |
7 |
|
8 |
create a new create_overlay_dict() to assist in using a python dictionary for overlay definitions |
9 |
|
10 |
--- |
11 |
layman/utils.py | 25 +++++++++++++++++++++++++ |
12 |
1 files changed, 25 insertions(+), 0 deletions(-) |
13 |
|
14 |
diff --git a/layman/utils.py b/layman/utils.py |
15 |
index 67a0ab7..86524ef 100644 |
16 |
--- a/layman/utils.py |
17 |
+++ b/layman/utils.py |
18 |
@@ -175,6 +175,31 @@ def delete_empty_directory(mdir, output=OUT): |
19 |
if getpass.getuser() != 'root': |
20 |
output.warn('Hint: You are not root.') |
21 |
|
22 |
+ |
23 |
+def create_overlay_dict(**kwargs): |
24 |
+ """Creates a complete empty reository definition. |
25 |
+ Then fills it with values passed in |
26 |
+ """ |
27 |
+ result = { |
28 |
+ 'name': '', |
29 |
+ 'owner_name': '', |
30 |
+ 'owner_email': '', |
31 |
+ 'homepage': '', |
32 |
+ 'irc': '', |
33 |
+ 'description': '', |
34 |
+ 'feeds': [], |
35 |
+ 'sources': [('','','')], |
36 |
+ 'priority': 50, |
37 |
+ 'quality': u'experimental', |
38 |
+ 'status': '', |
39 |
+ 'official': False, |
40 |
+ 'supported': False, |
41 |
+ } |
42 |
+ for key in kwargs: |
43 |
+ result[key] = kwargs[key] |
44 |
+ return result |
45 |
+ |
46 |
+ |
47 |
#=============================================================================== |
48 |
# |
49 |
# Testing |