1 |
commit: e23fced887c5579202326f1e9c8e6dc39ba63c1d |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 1 11:52:16 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 1 11:52:16 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e23fced8 |
7 |
|
8 |
Support reading the category list. |
9 |
|
10 |
--- |
11 |
PMSTestSuite/repository/__init__.py | 8 ++++++++ |
12 |
1 files changed, 8 insertions(+), 0 deletions(-) |
13 |
|
14 |
diff --git a/PMSTestSuite/repository/__init__.py b/PMSTestSuite/repository/__init__.py |
15 |
index cb5d0ac..63af3dc 100644 |
16 |
--- a/PMSTestSuite/repository/__init__.py |
17 |
+++ b/PMSTestSuite/repository/__init__.py |
18 |
@@ -29,6 +29,14 @@ class EbuildRepository(object): |
19 |
self.repo_name = f.readline().strip() |
20 |
f.close() |
21 |
|
22 |
+ catspath = os.path.join(path, 'profiles', 'categories') |
23 |
+ try: |
24 |
+ f = open(catspath, 'r'); |
25 |
+ self.categories = [l.strip() for l in f.readlines()] |
26 |
+ f.close() |
27 |
+ except IOError: |
28 |
+ self.categories = [] |
29 |
+ |
30 |
if not self.repo_name: |
31 |
raise ValueError('Repository %s has invalid name.' % path) |