<commit_before>require 'formula'

class Swatchbooker < Formula
  homepage 'http://www.selapa.net/swatchbooker/'
  url 'http://launchpad.net/swatchbooker/trunk/0.7.3/+download/SwatchBooker-0.7.3.tar.gz'
  sha1 'fd2e46c278e762dc0c3ed69f824ab620773f153e'

  depends_on 'little-cms' # needs --with-python
  depends_on 'pil'
  depends_on 'pyqt'

  def install
    # Tell launching shell scipts where the python library is
    inreplace %w[data/swatchbooker data/sbconvert data/sbconvertor] do |s|
      s.gsub! "/usr/lib", "#{HOMEBREW_PREFIX}/lib"
    end

    system "python", "setup.py", "build"
    system "python", "setup.py", "install", "--prefix=#{prefix}"
  end

  def caveats; <<-EOS.undent
    For the graphical user interface to work, PyQT requires that you amend your PYTHONPATH:
      export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/python:$PYTHONPATH
    EOS
  end<commit_msg>swatchbooker: depends on little-cms with-python<commit_after>require 'formula'

class Swatchbooker < Formula
  homepage 'http://www.selapa.net/swatchbooker/'
  url 'http://launchpad.net/swatchbooker/trunk/0.7.3/+download/SwatchBooker-0.7.3.tar.gz'
  sha1 'fd2e46c278e762dc0c3ed69f824ab620773f153e'

  depends_on 'little-cms' => 'with-python'
  depends_on 'pil'
  depends_on 'pyqt'

  def install
    # Tell launching shell scipts where the python library is
    inreplace %w[data/swatchbooker data/sbconvert data/sbconvertor] do |s|
      s.gsub! "/usr/lib", "#{HOMEBREW_PREFIX}/lib"
    end

    system "python", "setup.py", "build"
    system "python", "setup.py", "install", "--prefix=#{prefix}"
  end

  def caveats; <<-EOS.undent
    For the graphical user interface to work, PyQT requires that you amend your PYTHONPATH:
      export PYTHONPATH=#{HOMEBREW_PREFIX}/lib/python:$PYTHONPATH
    EOS
  end
{'fraction_non_alphanumeric': 0.126752664049355, 'fraction_numerical': 0.0358945597307908, 'mean_word_length': 3.9555555555555557, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4016225', 'n_tokens_mistral': 710, 'n_tokens_neox': 654, 'n_words': 144}