コード例 #1
0
  def Write(self):
    """Writes a setup.cfg file."""
    file_content = []
    file_content.extend(self._FILE_HEADER)
    file_content.extend(self._PYTHON2_PACKAGE_HEADER)

    dependencies = dfvfs.dependencies.GetDPKGDepends()
    dependencies = u', '.join(dependencies)
    file_content.append(
        u'Depends: {0:s}, ${{python:Depends}}, ${{misc:Depends}}'.format(
            dependencies))

    file_content.extend(self._PYTHON_PACKAGE_FOOTER)
    file_content.extend(self._PYTHON3_PACKAGE_HEADER)

    dependencies = dfvfs.dependencies.GetDPKGDepends()
    dependencies = u', '.join(dependencies)
    dependencies = dependencies.replace(u'python', u'python3')
    file_content.append(
        u'Depends: {0:s}, ${{python:Depends}}, ${{misc:Depends}}'.format(
            dependencies))

    file_content.extend(self._PYTHON_PACKAGE_FOOTER)

    file_content = u'\n'.join(file_content)
    file_content = file_content.encode(u'utf-8')

    with open(self._PATH, 'wb') as file_object:
      file_object.write(file_content)
コード例 #2
0
ファイル: update_dependencies.py プロジェクト: devgc/dfvfs
    def Write(self):
        """Writes a setup.cfg file."""
        file_content = []
        file_content.extend(self._FILE_HEADER)

        dependencies = dfvfs.dependencies.GetDPKGDepends(exclude_version=True)
        dependencies.append(u'python-lzma')
        dependencies = u' '.join(sorted(dependencies))
        file_content.append(
            u'PYTHON2_DEPENDENCIES="{0:s}";'.format(dependencies))

        file_content.append(u'')

        dependencies = dfvfs.dependencies.GetDPKGDepends(exclude_version=True)
        dependencies = u' '.join(dependencies)
        dependencies = dependencies.replace(u'python', u'python3')
        file_content.append(
            u'PYTHON3_DEPENDENCIES="{0:s}";'.format(dependencies))

        file_content.extend(self._FILE_FOOTER)

        file_content = u'\n'.join(file_content)
        file_content = file_content.encode(u'utf-8')

        with open(self._PATH, 'wb') as file_object:
            file_object.write(file_content)