~kelemeng/checkbox/bug868571

« back to all changes in this revision

Viewing changes to checkbox/registry.py

  • Committer: Marc Tardif
  • Date: 2008-08-13 20:04:12 UTC
  • Revision ID: marc.tardif@canonical.com-20080813200412-52u3d6fs6ulnxlgv
Renamed hwtest to checkbox.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#
4
4
# Written by Marc Tardif <marc@interunion.ca>
5
5
#
6
 
# This file is part of HWTest.
 
6
# This file is part of Checkbox.
7
7
#
8
 
# HWTest is free software: you can redistribute it and/or modify
 
8
# Checkbox is free software: you can redistribute it and/or modify
9
9
# it under the terms of the GNU General Public License as published by
10
10
# the Free Software Foundation, either version 3 of the License, or
11
11
# (at your option) any later version.
12
12
#
13
 
# HWTest is distributed in the hope that it will be useful,
 
13
# Checkbox is distributed in the hope that it will be useful,
14
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
16
# GNU General Public License for more details.
17
17
#
18
18
# You should have received a copy of the GNU General Public License
19
 
# along with HWTest.  If not, see <http://www.gnu.org/licenses/>.
 
19
# along with Checkbox.  If not, see <http://www.gnu.org/licenses/>.
20
20
#
21
21
import re
22
22
 
23
 
from hwtest.repository import Repository, RepositoryManager
24
 
from hwtest.lib.cache import cache
 
23
from checkbox.repository import Repository, RepositoryManager
 
24
from checkbox.lib.cache import cache
25
25
 
26
26
 
27
27
class Registry(Repository):
58
58
            return self.__getitem__(key)
59
59
        except KeyError:
60
60
            if default == None:
61
 
                from hwtest.registries.none import NoneRegistry
 
61
                from checkbox.registries.none import NoneRegistry
62
62
                return NoneRegistry(None)
63
63
            else:
64
64
                return default
71
71
            yield k, v
72
72
 
73
73
    def iterkeys(self):
74
 
        from hwtest.registries.link import LinkRegistry
 
74
        from checkbox.registries.link import LinkRegistry
75
75
 
76
76
        for k, v in self.items():
77
77
            # Prevent returning links in a dict() context
82
82
        return list(self.iterkeys())
83
83
 
84
84
    def itervalues(self):
85
 
        from hwtest.registries.link import LinkRegistry
 
85
        from checkbox.registries.link import LinkRegistry
86
86
 
87
87
        for k, v in self.items():
88
88
            # Prevent returning links in a values() context