Esempio n. 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
Esempio n. 2
0
 def __init__(self,
              package=None,
              version=None,
              save_dir=None,
              template=settings.DEFAULT_TEMPLATE,
              distro=settings.DEFAULT_DISTRO,
              base_python_version=settings.DEFAULT_PYTHON_VERSION,
              python_versions=[],
              rpm_name=None,
              proxy=None,
              venv=True):
     self.package = package
     self.version = version
     self.save_dir = save_dir
     self.base_python_version = base_python_version
     self.python_versions = list(python_versions)
     self.template = template
     self.name_convertor = name_convertor.NameConvertor(distro)
     if not self.template.endswith('.spec'):
         self.template = '{0}.spec'.format(self.template)
     self.rpm_name = rpm_name
     self.proxy = proxy
     self.venv = venv
     self.pypi = True
     suffix = os.path.splitext(self.package)[1]
     if os.path.exists(self.package) and suffix in settings.ARCHIVE_SUFFIXES\
             and not os.path.isdir(self.package):
         self.pypi = False
Esempio n. 3
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
Esempio n. 4
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
Esempio n. 5
0
 def __init__(self,
              name=None,
              version=None,
              save_dir=settings.DEFAULT_PKG_SAVE_PATH,
              template=settings.DEFAULT_TEMPLATE,
              distro=settings.DEFAULT_DISTRO,
              source_from=settings.DEFAULT_PKG_SOURCE,
              metadata_from=settings.DEFAULT_METADATA_SOURCE,
              base_python_version=settings.DEFAULT_PYTHON_VERSION,
              python_versions=[],
              rpm_name=None):
     self.name = name
     self.version = version
     self.save_dir = save_dir
     self.source_from = source_from
     self.metadata_from = metadata_from
     self.base_python_version = base_python_version
     self.python_versions = python_versions
     self.template = template
     self.name_convertor = name_convertor.NameConvertor(distro)
     if not self.template.endswith('.spec'):
         self.template = '{0}.spec'.format(self.template)
     self.rpm_name = rpm_name
Esempio n. 6
0
 def __init__(self,
              package=None,
              version=None,
              save_dir=None,
              template=settings.DEFAULT_TEMPLATE,
              distro=settings.DEFAULT_DISTRO,
              base_python_version=settings.DEFAULT_PYTHON_VERSION,
              python_versions=[],
              rpm_name=None,
              proxy=None):
     self.package = package
     self.version = version
     self.save_dir = save_dir
     self.base_python_version = base_python_version
     self.python_versions = python_versions
     self.template = template
     self.name_convertor = name_convertor.NameConvertor(distro)
     if not self.template.endswith('.spec'):
         self.template = '{0}.spec'.format(self.template)
     self.rpm_name = rpm_name
     self.proxy = proxy
     self.pypi = True
     if os.path.exists(self.package):
         self.pypi = False