From 9cefce255de597e4dc8e9d5ff30acc72670641e1 Mon Sep 17 00:00:00 2001 From: Adam Sanderson Date: Sat, 11 Dec 2010 23:26:05 -0800 Subject: [PATCH] Basic support for python --- lib/qwandry/launcher.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/qwandry/launcher.rb b/lib/qwandry/launcher.rb index b3ca0bf..569f1bd 100644 --- a/lib/qwandry/launcher.rb +++ b/lib/qwandry/launcher.rb @@ -101,6 +101,14 @@ module Qwandry add :perl, path, :class=>Qwandry::LibraryRepository end + # add python repositories: + python_paths = `python -c 'import sys;print \"\\n\".join(sys.path)'` rescue '' + python_paths.split("\n").reject{|path| path == '' || path == '.' || path =~ /\.zip$/ || path =~/lib-dynload$/}.each do |path| + add :python, path, :class=>Qwandry::LibraryRepository, :reject => /\.(py[oc])|(egg-info)$/ + end + + # Qwandry is a ruby app after all, so activate ruby and rubygems by default. Other defaults can be set + # with a custom init.rb activate :ruby, :gem end