def __init__(self, package=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.package = package atom = "=" + package.cpv if package.repo != Package.UNKNOWN_REPO: atom += _repo_separator + package.repo self.atom = portage.dep.Atom(atom, allow_repo=True) self.pset = InternalPackageSet(initial_atoms=(self.atom,), allow_repo=True)
def __init__(self, package=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.package = package atom = "=" + package.cpv if package.repo != Package.UNKNOWN_REPO: atom += _repo_separator + package.repo self.atom = portage.dep.Atom(atom, allow_repo=True) self.pset = InternalPackageSet(initial_atoms=(self.atom, ), allow_repo=True)
def testDependencyArg(self): self.assertEqual(_encodings['content'], 'utf_8') for arg_unicode in self.unicode_strings: arg_bytes = _unicode_encode(arg_unicode, encoding=_encodings['content']) dependency_arg = DependencyArg(arg=arg_unicode) # Use unicode_literals for unicode format string so that # __unicode__() is called in Python 2. formatted_str = "%s" % (dependency_arg, ) self.assertEqual(formatted_str, arg_unicode) if STR_IS_UNICODE: # Test the __str__ method which returns unicode in python3 formatted_str = "%s" % (dependency_arg, ) self.assertEqual(formatted_str, arg_unicode) else: # Test the __str__ method which returns encoded bytes in python2 formatted_bytes = b"%s" % (dependency_arg, ) self.assertEqual(formatted_bytes, arg_bytes)
def testDependencyArg(self): self.assertEqual(_encodings['content'], 'utf_8') for arg_unicode in self.unicode_strings: arg_bytes = _unicode_encode(arg_unicode, encoding=_encodings['content']) dependency_arg = DependencyArg(arg=arg_unicode) formatted_str = "%s" % (dependency_arg, ) self.assertEqual(formatted_str, arg_unicode) # Test the __str__ method which returns unicode in python3 formatted_str = "%s" % (dependency_arg, ) self.assertEqual(formatted_str, arg_unicode)
def __init__(self, set=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.set = set self.name = self.arg[len(SETPREFIX):]
def __init__(self, pset=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.pset = pset self.name = self.arg[len(SETPREFIX):]
def __init__(self, atom=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.atom = atom self.pset = InternalPackageSet(initial_atoms=(self.atom, ), allow_repo=True)
def __init__(self, package=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.package = package self.atom = portage.dep.Atom("=" + package.cpv) self.set = (self.atom, )
def __init__(self, atom=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.atom = atom self.set = (self.atom, )
def __init__(self, atom=None, **kwargs): DependencyArg.__init__(self, **kwargs) self.atom = atom self.pset = InternalPackageSet(initial_atoms=(self.atom,), allow_repo=True)