Files @ 31f510a88584
Branch filter:

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

Bradley M. Kuhn
Update minified YUI to version 2.9 built from Source.

yui.2.9.js used to be a minified version of YUI 2.9 until 5143b8df576c updated
it to something else and applied more aggresive minification. We stick to a
clean but minified version 2.9.

The license of YUI is BSD 3-clause, as described on
http://yuilibrary.com/license/ .

Since the minified version combines with GPLv3'd Javascript, it is only GPLv3'd
compliant to distribute this Object Code version with the Corresponding Source
(or offer therefor).

This yui.2.9.js is built from Source this way:
git clone https://github.com/yui/builder
git clone https://github.com/yui/yui2
cd yui2/
git checkout hudson-yui2-2800
ln -sf JumpToPageDropDown.js src/paginator/js/JumpToPageDropdown.js # work around inconsistent casing
rm -f tmp.js
for m in yahoo event dom connection animation dragdrop element datasource autocomplete container event-delegate json datatable paginator; do
rm -f build/$m/$m.js; ( cd src/$m && ant build deploybuild ) && sed -e 's,@VERSION@,2.9.0,g' -e 's,@BUILD@,2800,g' build/$m/$m.js >> tmp.js
done
java -jar ../builder/componentbuild/lib/yuicompressor/yuicompressor-2.4.4.jar tmp.js -o yui.2.9.js

The source is mirrored and available on https://kallithea-scm.org/repos/mirror .
# -*- 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]()