Files @ 6af3e67cc576
Branch filter:

Location: kallithea/rhodecode/lib/vcs/utils/archivers.py - annotation

Bradley M. Kuhn
Add Twitter's Bootstrap 3.0.0 CSS and Javascript files, under Apache License 2.0

These files are exactly as they appear the upstream release 3.0.0 of
Bootstrap, which Twitter released under the Apache License 2.0. To extract
these files, I did the following:

I downloaded the following file:
https://github.com/twbs/bootstrap/archive/v3.0.0.zip

with sha256sum of:
$ sha256sum v3.0.0.zip
2d54f345f4abc6bf65ea648c323e9bae577e6febf755650e62555f2d7a222e17 v3.0.0.zip

And extracted from it these two files:
bootstrap-3.0.0/dist/css/bootstrap.css
bootstrap-3.0.0/dist/js/bootstrap.js
which are licensed under the Apache License 2.0.

and placed them into:
rhodecode/public/css/bootstrap.css
rhodecode/public/js/bootstrap.js
respectively.
# -*- coding: utf-8 -*-
"""
    vcs.utils.archivers
    ~~~~~~~~~~~~~~~~~~~

    set of archiver functions for creating archives from repository content

    :created_on: Jan 21, 2011
    :copyright: (c) 2010-2011 by Marcin Kuzminski, Lukasz Balcerzak.
"""


class BaseArchiver(object):

    def __init__(self):
        self.archive_file = self._get_archive_file()

    def addfile(self):
        """
        Adds a file to archive container
        """
        pass

    def close(self):
        """
        Closes and finalizes operation of archive container object
        """
        self.archive_file.close()

    def _get_archive_file(self):
        """
        Returns container for specific archive
        """
        raise NotImplementedError()


class TarArchiver(BaseArchiver):
    pass


class Tbz2Archiver(BaseArchiver):
    pass


class TgzArchiver(BaseArchiver):
    pass


class ZipArchiver(BaseArchiver):
    pass


def get_archiver(self, kind):
    """
    Returns instance of archiver class specific to given kind

    :param kind: archive kind
    """

    archivers = {
        'tar': TarArchiver,
        'tbz2': Tbz2Archiver,
        'tgz': TgzArchiver,
        'zip': ZipArchiver,
    }

    return archivers[kind]()