Exemple #1
0
    def __init__(self, verbose=True):
        """ Constructor """
        Observed.__init__(self)
        self.log = Logger()

        # make urlparse correctly handle the glorious "oa" protocol :)
        six.moves.urllib.parse.uses_query.append("oa")

        self.verbose = verbose
        # remove namespace option
        # self.include_namespace = self.get_include_namespace()

        # save system path
        self.old_syspath = sys.path[:]

        # dictionnary of packages
        self.pkgs = PackageDict()

        # dictionnary of category
        self.category = PseudoGroup("")

        # dictionary of standard categories
        self.user_category = PackageManagerCategory()

        # list of path to search wralea file related to the system
        self.user_wralea_path = set()
        self.sys_wralea_path = set()
        # for packages that we don't want to save in the config file
        self.temporary_wralea_paths = set()

        # Compute system and user PATH to look for packages
        self.set_user_wralea_path()
        self.set_sys_wralea_path()
Exemple #2
0
    def clear(self):
        """ Remove all packages """

        self.user_wralea_path = set()
        self.sys_wralea_path = set()

        self.pkgs = PackageDict()
        self.recover_syspath()
        self.category = PseudoGroup('Root')
Exemple #3
0
def test_dict():
    """Test packageDict"""
    d = PackageDict()
    d['AbC'] = 3
    assert d['aBc'] == 3
    print(d)