Пример #1
0
 def name_convertor(self):
     if not hasattr(self, '_name_convertor'):
         name_convertor.NameConvertor.template = os.path.splitext(
             self.template)[0]
         if self.autonc or (self.autonc is None and
                            (self.template == 'fedora.spec'
                             or self.template == 'mageia.spec')):
             logger.debug("Using AutoProvidesNameConvertor to convert "
                          "names of the packages.")
             self._name_convertor = name_convertor.AutoProvidesNameConvertor(
                 self.distro)
         elif dnf is None:
             logger.warn("Dnf module not found, please dnf install "
                         "python{0}-dnf to improve accuracy of name "
                         "conversion.".format(sys.version[0]))
             logger.debug(
                 "Using NameConvertor to convert names of the packages.")
             self._name_convertor = name_convertor.NameConvertor(
                 self.distro)
         else:
             logger.debug("Using DandifiedNameConvertor to convert names "
                          "of the packages.")
             self._name_convertor = name_convertor.DandifiedNameConvertor(
                 self.distro)
     return self._name_convertor
Пример #2
0
 def name_convertor(self):
     if not hasattr(self, '_name_convertor'):
         if dnf is None:
             self._name_convertor = name_convertor.NameConvertor(
                 self.distro)
         else:
             self._name_convertor = name_convertor.DandifiedNameConvertor(
                 self.distro)
     return self._name_convertor
Пример #3
0
 def name_convertor(self):
     if not hasattr(self, '_name_convertor'):
         if dnf is None:
             logger.warn(
                 "Dnf module not found, please dnf install python{0}-dnf "
                 "to improve accuracy of name conversion.".format(
                     sys.version[0]))
             logger.debug(
                 "Using NameConvertor to convert names of the packages.")
             self._name_convertor = name_convertor.NameConvertor(
                 self.distro)
         else:
             logger.debug(
                 "Using DandifiedNameConvertor to convert names of the packages."
             )
             self._name_convertor = name_convertor.DandifiedNameConvertor(
                 self.distro)
     return self._name_convertor