Exemple #1
0
    def __init__(self, name):
        """Initializes a COPR manager.

    Args:
      name (str): name of the group.
    """
        super(COPRProjectManager, self).__init__()
        self._download_helper = interface.DownloadHelper('')
        self._name = name
Exemple #2
0
    def __init__(self, name, distribution=None):
        """Initializes a COPR manager.

    Args:
      name (str): name of the group.
      distribution (Optional[str]): name of the distribution.
    """
        super(COPRProjectManager, self).__init__()
        self._distribution = distribution or definitions.DEFAULT_FEDORA_DISTRIBUTION
        self._download_helper = interface.DownloadHelper('')
        self._name = name
Exemple #3
0
    def __init__(self, name, distribution=None):
        """Initializes a Launchpad PPA manager.

    Args:
      name (str): name of the PPA.
      distribution (Optional[str]): name of the distribution.
    """
        super(LaunchpadPPAManager, self).__init__()
        self._distribution = distribution or definitions.DEFAULT_UBUNTU_DISTRIBUTION
        self._download_helper = interface.DownloadHelper('')
        self._name = name
Exemple #4
0
    def __init__(self, name, distribution='trusty'):
        """Initializes a Launchpad PPA manager.

    Args:
      name (str): name of the PPA.
      distribution (Optional[str]): name of the distribution.
    """
        super(LaunchpadPPAManager, self).__init__()
        self._distribution = distribution
        self._download_helper = interface.DownloadHelper('')
        self._name = name
Exemple #5
0
  def __init__(self, name, distribution='28'):
    """Initializes a COPR manager.

    Args:
      name (str): name of the group.
      distribution (Optional[str]): name of the distribution.
    """
    super(COPRProjectManager, self).__init__()
    self._distribution = distribution
    self._download_helper = interface.DownloadHelper('')
    self._name = name
Exemple #6
0
    def testDownloadPageContent(self):
        """Tests the DownloadPageContent functions."""
        download_helper = interface.DownloadHelper('')

        page_content = download_helper.DownloadPageContent(self._download_url)

        expected_page_content = b''
        with open(self._FILENAME, 'rb') as file_object:
            expected_page_content = file_object.read()
            expected_page_content = expected_page_content.decode('utf-8')

        self.assertEqual(page_content, expected_page_content)
Exemple #7
0
  def __init__(self, projects_file):
    """Initializes a PyPI manager.

    Args:
      projects_file (str): path to the projects.ini file.
    """
    super(PyPIManager, self).__init__()
    self._download_helper = interface.DownloadHelper('')
    self._package_names = []
    self._pypi_package_names = {}

    if projects_file:
      with io.open(projects_file, 'r', encoding='utf-8') as file_object:
        project_definition_reader = projects.ProjectDefinitionReader()
        for project_definition in project_definition_reader.Read(file_object):
          self._package_names.append(project_definition.name)

          if project_definition.pypi_name:
            self._pypi_package_names[project_definition.pypi_name] = (
                project_definition.name)
Exemple #8
0
    def testDownloadFile(self):
        """Tests the DownloadFile functions."""
        download_helper = interface.DownloadHelper(self._download_url)

        current_working_directory = os.getcwd()

        page_content = b''
        with test_lib.TempDirectory() as temporary_directory:
            os.chdir(temporary_directory)
            filename = download_helper.DownloadFile(self._download_url)

            with open(filename, 'rb') as file_object:
                page_content = file_object.read()

        os.chdir(current_working_directory)

        expected_page_content = b''
        with open(self._FILENAME, 'rb') as file_object:
            expected_page_content = file_object.read()

        self.assertEqual(page_content, expected_page_content)
Exemple #9
0
 def __init__(self):
     """Initializes a GitHub repository manager."""
     super(GithubRepoManager, self).__init__()
     self._download_helper = interface.DownloadHelper('')
Exemple #10
0
 def __init__(self):
     """Initializes a PyPI manager object."""
     super(PyPIManager, self).__init__()
     self._download_helper = interface.DownloadHelper('')