コード例 #1
0
    def download(self, url=None, checksum=None):
        """ Download and extract the source code from the web.

        :param str url: Url to the zipped source code.
        :param str checksum: Sha256 hash of the archive.
        :return void:
        """
        from tarballfetcher import download_and_extract_tarball
        download_and_extract_tarball(url or self.DEFAULT_URI,
                                     expected_sha256=checksum
                                     or self.DEFAULT_CHECKSUM)
コード例 #2
0
ファイル: setup.py プロジェクト: zurk/pystemmer
import os.path
import sys


def build_ext(*args, **kwargs):
    from Cython.Distutils import build_ext
    return build_ext(*args, **kwargs)


# Directory which libstemmer sources are unpacked in.
library_dir = 'libstemmer_c'

if 'bootstrap' in sys.argv:
    from tarballfetcher import download_and_extract_tarball
    download_and_extract_tarball(
        'http://snowball.tartarus.org/dist/libstemmer_c.tgz',
        expected_md5='6f32f8f81cd6fa0150333ab540af5e27')
    sys.argv.remove('bootstrap')

if not os.path.exists(library_dir):
    sys.stderr.write('WARNING: Directory `%s` does not exist. ' % library_dir +
                     'To download it, invoke setup.py with `bootstrap`.\n')

# Directories in libstemmer which contain libstemmer sources (ie, not
# examples, etc).
library_core_dirs = ('src_c', 'runtime', 'libstemmer', 'include')

# Read the manifest of files in libstemmer.
src_files = [
    os.path.join(library_dir,
                 line.strip().replace(' \\', ''))
コード例 #3
0
ファイル: setup.py プロジェクト: snowballstem/pystemmer
import os.path
import sys

try:
    from Cython.Distutils import build_ext
    have_pyrex = 1
except:
    have_pyrex = 0

# Directory which libstemmer sources are unpacked in.
library_dir = 'libstemmer_c'

if 'bootstrap' in sys.argv:
    from tarballfetcher import download_and_extract_tarball
    download_and_extract_tarball(
        'http://snowball.tartarus.org/dist/libstemmer_c.tgz',
        expected_md5='6f32f8f81cd6fa0150333ab540af5e27')
    sys.argv.remove('bootstrap')

if not os.path.exists(library_dir):
    sys.stderr.write(
        'WARNING: Directory `%s` does not exist. ' % library_dir +
        'To download it, invoke setup.py with `bootstrap`.\n')

# Directories in libstemmer which contain libstemmer sources (ie, not
# examples, etc).
library_core_dirs = ('src_c', 'runtime', 'libstemmer', 'include')

# Read the manifest of files in libstemmer.
src_files = [os.path.join(library_dir, line.strip().replace(' \\', ''))
             for line in open(os.path.join(library_dir, 'mkinc_utf8.mak'))
コード例 #4
0
 def run(self):
     from tarballfetcher import download_and_extract_tarball
     download_and_extract_tarball(
         self.libstemmer_url, expected_md5=self.libstemmer_md5)